{"id":"kernighan-bit-clear-loop","text":"`hamming_weight` uses Brian Kernighan's `n &= n - 1` trick, iterating exactly k times for k set bits rather than a fixed 32 iterations","truth_value":"IN","source":"entries/2026/06/06/number-of-1-bits-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"kernighan-bit-clear-loop","truth_value":"IN","reason":"premise"}]}}