m × n grid of integers grid. Numbers never decrease from left to right along each row, nor from top to bottom along each column. The end of one row does not have to be smaller than the start of the next one.
Return True if value appears in the grid, otherwise False. Checking every cell one by one is too slow: find something faster.grid=[[1, 5, 9], [3, 6, 12], [8, 10, 14]], value=10 → True
10 is in the last row, second column.
grid=[[1, 5, 9], [3, 6, 12], [8, 10, 14]], value=7 → False
The grid has no 7.
grid=[[1, 5, 9], [3, 6, 12], [8, 10, 14]], value=10
True
Run checks the first 3 tests in your browser. Submit checks all 86 tests on the server, hidden ones included.