Qualcomm Interview Question

Basic bit manipulation question, with a dynamic programming twist.