Closed 072arushi closed 2 years ago
/assign
Hello @072arushi, thanks for creating your first issue at LearnCPP, hope you followed the guidelines.
This issue has been assigned to 072arushi! It will become unassigned if it is not closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.
Description
In a stock market, there is a product with infinite stocks. The stock prices are given for N days, where arr[i] denotes the price of the stock on an ith day. There is a rule that a customer can buy at most I stock on an ith day. If the customer has an amount of k amount of money initially, find out the maximum number of stocks a customer can buy. For example, for 3 days the price of a stock is given as 7, 10, 4. You can buy 1 stock worth 7 rs on day 1, 2 stocks worth 10 rs each on day 2, and 3 stocks worth 4 rs each on day 3.
Examples: Input : price[] = { 10, 7, 19 }, k = 45. Output : 4
Domain
CPP
Type of Contribution
Addition
Code of Conduct