Check If Binary String Has At Most One Segment Of Ones

easy
Given a binary string 's' without leading zeroes, return true if s contains at most one contiguous segment of ones. Otherwise, return false.

Input Format

Input and output are managed for you. Just complete the function.

Output Format

Input and output are managed for you. Just complete the function.

Constraints

1 <= s.length <= 100
s[i] is either '0' or '1'
s[0] is '1'

Notice

NA

Example

Input
11100011
Output
false
Previous
Minimum Number Of Operations To Move All Balls To Each Box
Next
Maximum Absolute Sum Of Any Subarray

Related Questions