Given an array of cost of items at every shop . Each time a query is given with amount of
money user has and the starting index of shop . Return the maximum number of items user can buy.
Example
Item Array : [1,3,5,6,2,1]
Here Array[i] denotes the cost of item sold in shop i
Query 1 :
Amount = 11
Start Position = 2(1-indexed);
Soln : So user starts at postion 1(0-indexed) so it can visit shop 1 to the last shop
it will choose items optimally so that it can visit maximum shop within his given amount:
1 + 2 + 3+ 5=11 so it can buy 4 products in total (Products of cost 1, 2, 3 and 5 )