Skip to content

Commit

Permalink
Solution to #28
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatr21 committed May 30, 2020
1 parent a2c7c9e commit c86a7df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Solutions/S28.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
vector<int> countBits(int num) {
vector<int> res;
for(int i = 0; i <= num; i++)
{
res.push_back(__builtin_popcount(i));
}
return res;
}

0 comments on commit c86a7df

Please sign in to comment.