Skip to content

#CrackYourPlacement: Create Best Time to Buy and Sell Stock

Latest
Compare
Choose a tag to compare
@Tusar7684 Tusar7684 released this 05 Jul 07:06
· 44 commits to main since this release
8b758fe
First of all we take two integar as maximum profit whic is initially set to be zero and minimum so far which is the first element of the prices then we traverse and found the minimum between the minsofar and prices then we calculate the profit among them. then we find out the max between the maxprofit and calculated profit.