Maximum money
CodeChefOpen on judge ↗
There are N number of people sitting in a line. Every person in this line has some amount of money with him, X[i] where i denotes the position of the person in the line. This amount can also be negative, indicating that the person is in debt. Chef wants to know the maximum amount that can be formed by considering a contiguous subpart of this line. This subpart might also be empty. ### Input - The
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