Leftmost Column with At Least a One
CodingPhone ScreenSoftware EngineerReported Nov, 2025
Examples
Example 1:
Input: binaryMatrix = [[0,0],[1,1]]
Output: 0
Example 2:
Input: binaryMatrix = [[0,0],[0,0]]
Output: -1
Example 1:
Input: binaryMatrix = [[0,0],[1,1]]
Output: 0
Example 2:
Input: binaryMatrix = [[0,0],[0,0]]
Output: -1
This practice version receives the binary matrix directly as binaryMatrix, where every row is sorted in non-decreasing order.
Return the index of the leftmost column containing at least one 1, or -1 if no such column exists.
1 <= binaryMatrix.length, binaryMatrix[i].length <= 100Reported as LeetCode 1428 in a software engineer phone screen.