package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/circular-permutation-in-binary-representation/
 */
public class Problem1238 {
    public List<Integer> circularPermutation(int n, int start) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1238 prob = new Problem1238();
        System.out.println(prob.circularPermutation(2, 3)); // [3,2,0,1]
        System.out.println(prob.circularPermutation(3, 2)); // [2,6,7,5,4,0,1,3]
    }
}

@@ -12,16 +12,44 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -256,35 +256,246 @@
     
-// TODO%0A        return null
+List%3CInteger%3E answer = new ArrayList%3C%3E();%0A        answer.add(start);%0A        // TODO%0A        return answer;%0A    %7D%0A%0A    private static int binaryToGray(int n) %7B%0A        // https://en.wikipedia.org/wiki/Gray_code%0A        return n %5E (n %3E%3E 1)
 ;%0A  

Update problem 1238