Topic: Bit Manipulation Problem / Level: intermediate

Problem: Implement a function that generates a binary mask with all bits set to 1 except for the last k bits.

Run the code to see the output here...