grid where every row is strictly increasing. Find the smallest number that appears in every single row.
If no number is shared by all rows, return -1.grid=[[2, 4, 6, 8], [1, 4, 8, 9], [4, 5, 8, 10]] → 4
All three rows contain 4 and 8; the smaller of the two is 4.
grid=[[1, 3], [2, 4]] → -1
The rows share no number at all.
grid=[[2, 4, 6, 8], [1, 4, 8, 9], [4, 5, 8, 10]]
4
Run checks the first 3 tests in your browser. Submit checks all 90 tests on the server, hidden ones included.