Topic: Bit Manipulation Problem / Level: intermediate

Problem: Implement a function to calculate the sum of set bits for all numbers from 1 to n.

Run the code to see the output here...