Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In a stock market, there is a product with its infinite stocks. The stock prices are given for N days, where arr[i] denotes the price
In a stock market, there is a product with its infinite stocks. The stock prices are given for N days, where arr[i] denotes the price of the stock on ith day. There is a rule that a customer can buy at most i number of stocks on ith day(The index starts from 1 ). If the customer has an amount of K amount of money initially, find out the maximum number of stocks a customer can buy. Coding Window def buyMaximumProducts( n,k, price): \#write your code here n=int(input()) price = input ().split() for i in range (n) : price [i]=int(price[i]) k=int (input ()) print(buyMaximumProducts( n,k, price))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started