grid of zeros and ones. Find the row with the most 1s and return a list of two numbers: that row's index (0-based) and how many 1s it has.
If several rows tie, pick the one with the smallest index.grid=[[1, 0, 0], [1, 1, 0], [0, 1, 1]] → [1, 2]
Rows 1 and 2 both have two 1s, the maximum. The smaller index, 1, wins.
grid=[[0, 0], [0, 0]] → [0, 0]
There are no 1s anywhere, so every row ties and row 0 is chosen with a count of 0.
grid=[[0, 1, 0, 1], [1, 1, 1, 0]] → [1, 3]
grid=[[1, 0, 0], [1, 1, 0], [0, 1, 1]]
[1, 2]
Run checks the first 3 tests in your browser. Submit checks all 74 tests on the server, hidden ones included.