网站管理员容易做吗深圳aso优化
题目:
题解:
class Solution {
public:vector<int> countBits(int n) {vector<int> bits(n + 1);for (int i = 1; i <= n; i++) {bits[i] = bits[i & (i - 1)] + 1;}return bits;}
};
题目:
题解:
class Solution {
public:vector<int> countBits(int n) {vector<int> bits(n + 1);for (int i = 1; i <= n; i++) {bits[i] = bits[i & (i - 1)] + 1;}return bits;}
};