Search
⌘K

Leetcode 1428. Leftmost Column with at Least a One

Given a binary matrix where each row is sorted non-decreasing (all 0s before 1s) and you can only query entries via a provided API, find the leftmost column index that contains at least one 1 (or return -1 if none), optimizing for minimal queries/time. The key is to exploit the row-sorted property to avoid scanning the whole matrix.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.