package leetcode;

/**
 * https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/
 */
public class Problem1784 {
    public boolean checkOnesSegment(String s) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1784 prob = new Problem1784();
        System.out.println(prob.checkOnesSegment("1001")); // false
        System.out.println(prob.checkOnesSegment("110")); // true
    }
}

@@ -196,203 +196,206 @@
     
-// TODO%0A        return false;
+int i = 0;%0A        while (i %3C s.length() && s.charAt(i) == '1') %7B
 %0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1784 prob = new Problem1784();%0A        System.out.println(prob.checkOnesSegment(%221001%22)); //
+    i++;%0A        %7D%0A        for (; i %3C s.length(); i++) %7B%0A            if (s.charAt(i) == '1') %7B%0A                return
  false
+;
 %0A   
@@ -403,65 +403,44 @@
     
-System.out.println(prob.checkOnesSegment(%22110%22)); //
+    %7D%0A        %7D%0A        return
  true
+;
 %0A   

Solve problem 1784