package leetcode;

/**
 * https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n/
 */
public class Problem1023 {
    public boolean queryString(String S, int N) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1023 prob = new Problem1023();
        System.out.println(prob.queryString("0110", 3)); // true
        System.out.println(prob.queryString("0110", 4)); // false
    }
}

@@ -193,266 +193,197 @@
     
-// TODO%0A        return false
+for (int i = N; i %3E= 1; i--) %7B%0A            String s = Integer.toBinaryString(i)
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1023 prob = new Problem1023();%0A        System.out.println(prob.queryString(%220110%22, 3)); // true%0A        System.out.println(prob.queryString(%220110%22, 4)); // false
+    if (!S.contains(s)) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;
 %0A   

Solve problem 1023