Harsh And His Love For Money
CodeChefOpen on judge ↗
Harsh is a very intelligent investor. He has a very special ability as he knows the profit or the loss which will occur if he purchases that particular stock. But Harsh can only invest in $atmost$ 2 stocks. You have to help him find out what is the maximum profit he can earn after investing. You are given $N$ which is the length of the array $A$, where each $A[i]$ represents profit or loss he c
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.
Sign in to chat with the tutor and save your progress.
Sign in to start