Skip to content

Commit

Permalink
Rohit0301#55 issue solve
Browse files Browse the repository at this point in the history
#hacktoberfest
  • Loading branch information
Rahul-Bhati authored Oct 3, 2022
1 parent b1fc47b commit f5c589e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Leetcode/Counting_Bits#55.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Solution {
public int[] countBits(int n) {
int a[] = new int[n+1];
for(int i=1;i<=n;i++)
a[i] = a[i>>1] + i%2;
return a;
}
}

0 comments on commit f5c589e

Please sign in to comment.