Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- vector<int> countBits(int n) {
- vector<int> result;
- for(int i = 0; i <= n; i++) {
- result.push_back(__builtin_popcount(i));
- }
- return result;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement