Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions