← All problemsSign in

Find the Key

Tokyo and Denver have reached the Gold Chamber there they want a key to unlock it. They are given $N$ non- negative integers. But some the numbers are missing which are denoted by -1. Berlin knew the formula by which Tokyo can get the key but for that all elements are required. So according to Berlin Key is maximum absolute difference between adjacent elements. So you have to help Tokyo and Denver

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