Save The Princess
CodeChefOpen on judge ↗
Embrace! You are a prince in this question who is on a mission to save princess Priya. The world here is 1-Dimensional. Currently, you are at position 1 and princess is at position N. You need to reach position N to save the princess from demons. Saving the princess from demons is easy, but reaching there needs effort. Each position between 1 and N inclusive has a value associated to it. This va
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