I recently encountered a coding interview question which is broken down as follows.
You are given an array N which consists of pairs n which consist of a reward and a cost.
You are also given m which is the maximum cost you can incur.
Find the subset of N in which the sum of the reward is maximized and the sum of the cost does not exceed m.