← All problemsSign in

Jack Jump

Jack is a greedy boy and in front of him there are n islands and on every island he visits he either have to pay some amount of gold or will earn some amount of gold. You are given the information on which island he gets how much profit or loss. A1, A2, ..., An are the profit or loss in the respective islands. But he has few restrictions 1. He have to start from island number 1 and must end on

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