Birthday Card Collection HackerCards is a trendy new card game. Each type of HackerCard has a distinct ID number greater than or equal to 1, and the cost of each HackerCard equals its ID number. For example, HackerCard 1 costs 1, HackerCard 5 costs 5, and so on. Leanne already has a collection started. For her birthday, Mike wants to buy her as many cards as he can, but they must cost less than or equal to his budget. He wants to buy one each of some cards she does not already have. If he has to make one choice among several, he will always choose the lowest cost option. Determine which cards he will buy.
Example collection = [2, 4, 5] d=7 Leanne owns the cards in collection, and Mike has d = 7 to spend. He can purchase a maximum of 2 cards, cards 1 and 3, to add to her collection. Two other options he has are 1 and 6 (costs more) or 7 (fewer cards, costs more). Function Description Complete the function hackerCards in the editor below. hackerCards has the following parameter(s): int collection[n]: the ID numbers of cards in Leanne's collection int d: Mike's budget Constraints int[]: the ID's of the cards Mike will purchase, in ascending order Constraints • 1≤n≤105 • 1 ≤ collection[i] ≤ 10%, where 0 ≤i