1784. Check if Binary String Has at Most One Segment of Ones

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1784

class Solution:
    def checkOnesSegment(self, s: str) -> bool:
        return '01' not in s