Round 1
Questions:
Given an array price: [1-n] and m (discount), find the minimum price to spend to buy all the items.
Formula to use coupon: price[i]/2^x, where x is the number of coupons used.
Example: For price = [1, 2, 3] and m = 2, the answer is 3 (1 + 2 + (3/2^2)).
Sample Test Case:
price = [1, 2, 3] m = 2
Candidate's Approach
I tried sorting the array and then attempted to exhaust the m discounts as much as possible, but I failed on a couple of test cases.
Interviewer's Feedback
No feedback provided.