PayPal | SSE | OA
Anonymous User
676

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, example 3/2^1 , where x is the number of coupon

Sample test case: price[1,2,3] , m= 2
ans = 3
(1+2+(3/2^2))

I tried sorting and then tried exhausting the m as much as possible but failed couple of testcases

Comments (6)