← All problemsSign in

Rohan and Gold Business

Rohan has decided to trade in Gold. But as he is just starting out, he can only buy one unit of gold and then sell it at a later date. This is unfair for Rohan. To make up for this restriction, Rohan is given the price of gold of N days into the future from today. Can you help Rohan maximize his profit? Input The First line contains an integer T denoting the number of test cases. The description

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