@@ -0,0 +1,473 @@
+public class LeetCode0338 %7B%0A    public int%5B%5D countBits(int num)%0A    %7B%0A        int%5B%5D res = new int%5Bnum + 1%5D;%0A        for (int i = 1; i %3C= num; i++) %7B%0A            res%5Bi%5D = res%5Bi %3E%3E 1%5D + (i & 1);%0A        %7D%0A        return res;%0A    %7D%0A%0A    public static void main(String%5B%5D args)%0A    %7B%0A        LeetCode0038 leetcode = new LeetCode0038();%0A        int%5B%5D results = leetcode.countBits(5);%0A        for (int result : results) %7B%0A            System.out.println(result);%0A        %7D%0A    %7D%0A%7D%0A

Add LeetCode0338.java