Topic: Bit Manipulation Problem / Level: intermediate

Problem: Create a function that calculates the sum of all distinct powers of two that can be formed with the bits of a number.

Run the code to see the output here...