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 97ad4e5 commit 53494ffCopy full SHA for 53494ff
Dynamic Programming/338_Counting_Bits.java
@@ -2,7 +2,7 @@ class Solution {
2
public int[] countBits(int num) {
3
int[] result = new int[num + 1];
4
5
- for (int i = 1; i <= num; i++) {
+ for (int i = 0; i <= num; i++) {
6
if (i % 2 == 0) {
7
result[i] = result[i >> 1];
8
} else {
0 commit comments