We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3f44e4 commit 34f48d6Copy full SHA for 34f48d6
1 file changed
counting-bits/se6816.java
@@ -0,0 +1,9 @@
1
+class Solution {
2
+ public int[] countBits(int n) {
3
+ int[] list = new int[n + 1];
4
+ for(int i = 0; i <= n; i++) {
5
+ list[i] = Integer.bitCount(i);
6
+ }
7
+ return list;
8
9
+}
0 commit comments