Visa Inc. interview question

Dynamic programming, greedy approach, bit manipulation