Java/Check if Binary String Has at Most One Segment of Ones.java
<gh_stars>0public class Solution {

    /**
     * Time:   O(n)
     * Memory: O(1)
     */
    public boolean checkOnesSegment(String s) {
        return !s.contains("01");
    }
}
