<commit_before>// Time:  O(n)
// Space: O(n)

class Solution {
public:
    vector<int> countBits(int num) {
        vector<int> res{0};
        for (int i = 1; i <= num; ++i) {
            res.emplace_back(res[i >> 1] + (i & 1));<commit_msg>Update counting-bits.cpp<commit_after>// Time:  O(n)
// Space: O(n)

class Solution {
public:
    vector<int> countBits(int num) {
        vector<int> res{0};
        for (int i = 1; i <= num; ++i) {
            res.emplace_back((i & 1) + res[i >> 1]);
{'fraction_non_alphanumeric': 0.1947261663286004, 'fraction_numerical': 0.016227180527383367, 'mean_word_length': 2.3835616438356166, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4080042', 'n_tokens_mistral': 197, 'n_tokens_neox': 190, 'n_words': 48}