You are given an r × c matrix where each row is sorted ascending and the first value of each row is greater than the last value of the previous row. Determine whether target exists in the matrix, in O(log(r·c)).
Input
r ctargetOutput: true or false.
3 4 1 3 5 7 10 11 16 20 23 30 34 60 3
true
3 4 1 3 5 7 10 11 16 20 23 30 34 60 13
false
Run your code against the sample tests, or Submit to run the full suite.