Dynamic Programming Series

Dynamic Programming Series

Day - 2

Best time to buy and sell the stocks

Problem Description

You have an array for which the ith element is the price of a given stock on day i.

 

 

Problem Description

You have an array for which the ith element is the price of a given stock on day i.

 

 

You are only allowed to complete at most one transaction at a time(i.e., buy a stock or sell a stock).

 

Problem Description

You have an array for which the ith element is the price of a given stock on day i.

 

 

You are only allowed to complete at most one transaction at a time(i.e., buy a stock or sell a stock).

 

Design an algorithm to find the maximum profit.!!!!

deck

By Chirayu Jain