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 af285fb commit 1836a8fCopy full SHA for 1836a8f
counting-bits/f-exuan21.java
@@ -2,6 +2,9 @@
2
//space : O(n)
3
4
class Solution {
5
+
6
+ // f(n) = f(n >> 1) + (n & 1)
7
8
public int[] countBits(int n) {
9
int[] answer = new int[n + 1];
10
0 commit comments