LeetCode 1784. Check if Binary String Has at Most One Segment of Ones
Description https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/ Given a binary string s without leading zeros, return true if s contains at most one contiguous segment of ones. Otherwise, return false. Example 1: Input:…