← All problemsSign in

MOCK STOCK

The Chef has decided to invest his money in share market and on a specific stock.He has made presumptions of the cost of stock for certain number of days. Now you have to find out the maximum profit chef can achieve in those days by buying and selling the stock. The cost of a stock on each day is given in an array,find the max profit that the chef can make by buying and selling in those days. For

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start