public int solution(int N) {
        String s = Integer.toBinaryString(N);
        // System.out.println(s);
        int max = 0;
        int current = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c == '1') {
                if (current > max) {
                    max = current;
                }
                current = 0;
            } else {
                // System.out.println("add current=" + current);
                current++;
            }
        }
        return max;
    }