Count of first maximum no.of zero in which index
Problem to find the which row has a maximum number of zeros and print that row number.
Example-1:
Input : n = [ [1,1,1,1], [1,1,0,0], [1,0,0,0], [1,1,0,0]] Output : 2
Example-2:
Input : n = [ [1,1,1], [1,0,0], [1,0,1], [1,1,0]] Output : 1
Solution
n = [ [1,1,1,1], [1,1,0,0], [1,0,0,0], [1,1,0,0]] l = [] for x in n: a = x.count(0) l.append(a) b = max(l) c = l.index(b) print(c)
Output
2