{"id":"counting-bits-dp-recurrence","text":"`countBits` computes popcount via `ans[i] = ans[i >> 1] + (i & 1)`, decomposing each value's popcount into its right-shifted prefix plus its LSB, achieving O(1) per element.","truth_value":"IN","source":"entries/2026/06/06/counting-bits-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"counting-bits-dp-recurrence","truth_value":"IN","reason":"premise"}]}}