Check if Binary String Has at Most One Segment of Ones LeetCode solution in Python

1
# Runtime: 42 ms (Top 66.03%) | Memory: 13.8 MB (Top 52.02%)
2
class Solution:
3
def checkOnesSegment(self, s: str) -> bool:
4
return "01" not in s

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0