Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1784. Check if Binary String Has at Most One Segment of Ones
Check whether a binary string (guaranteed to start with '1') contains at most one contiguous run of '1's — equivalently, verify that the pattern '1...0...1' never occurs. Return true if all ones form a single segment, otherwise false.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.