First Free Spot
Easy · rating 850 · Strings, Arrays
A parking row is a string of 0 (free) and 1 (taken). Print the 0-based index of the first free spot, or -1 if the row is full.
Constraints: 1 ≤ length ≤ 105
Related problems
- Array Sum — Easy
- Contains Duplicate — Easy
- Length of Last Word — Easy
- Minimum and Maximum — Easy
- Minimum of an Array — Easy
- Passing Students — Easy