shabaNAMINATA6 shabaNAMINATA6
  • 06-11-2020
  • Business
contestada

Create your own buy and sell stock problem

Respuesta :

brachac77
brachac77 brachac77
  • 06-11-2020

Answer:

The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling in those days. For example, if the given array is {100, 180, 260, 310, 40, 535, 695}, the maximum profit can earned by buying on day 0, selling on day 3. Again buy on day 4 and sell on day 6. If the given array of prices is sorted in decreasing order, then profit cannot be earned at all.

Explanation:

Answer Link

Otras preguntas

suppose you had D dollars in your bank account. you spent $22 but have at least $28 left. how much money did you have initially? write and solve an inequality t
Hello! How to sketch the graph?
is it possible to write vector (-5,6) as a linear combination of vectors (1,2) and (3,4)
quick thanks !!!! please
This is for 25 Points name me 14 NFL Players and tell me why you picked those players?
jack had m problems to complete during his vacation. (a) how many problems did jack solve per day? (b) suppose jack was solving 15 problems per day. (c) How man
Consider the quadratic equation x3 = 48-5. How many solutions does the equation have?
Order the atoms from largest to smallest: Cs , Si , Sn .
if a number is added by 2 the answer is10 find the number
Why is the speed of different sounds in a single medium remain the same though wavelength is different?