Leftmost column with a one in a row-sorted binary matrix
In an m x n matrix of 0s and 1s, each row has all its 0s before its 1s. Return the index of the leftmost column that holds a 1, or -1 if there is none.
Start with a binary search on each row, then improve to O(m + n) by walking from the top-right corner.
No answer yet. Write the first one; the best answer gets endorsed.
