Virtu·Data Scientist·Online Assessment (OA)
- You have n cards, each with a cost and a multiplier. Starting from some initial point value, you can buy any subset of cards in any order, as long as you can afford each card when you buy it. Buying a card subtracts its cost then multiplies your remaining points by its multiplier. Find the order and subset of cards that maximizes your final points.
“My first instinct was greedy, sort by multiplier descending and buy whatever you can afford.”