Counting Bits

Editorial
Bit ManipulationDynamic Programming