Find the row representing the smallest integer in row wise sorted matrix
Start with row 1. Go right until you hit the first 1. Then go down to row 2, but remain in the same column and repeat the process of going right until you hit a 1. Do this repeatedly. The row in which you last stepped right is your answer. This is an O(N+M) solution … Read more