I have a 2d array which has either a 0 or 1 contained within, i want to write a program that checks to see if there a two 1 lying on the same row or column. It should be a O(n**2) algorithm. I have written in python a for loop which loops through the array but i don't get how i can check to see if two 1 are contained in either the row or column, maybe someone can give me some tips. Thanks in advance
a = [[1,0,1,1],[0,1,0,1]]
for i in range(len(a)) :
for j in range(len(a[i])) :
print(a[i][j], end=" ")
print()