← All problemsSign in

The Mortys Portal

Morty is at an inter-galactic Dimension station. He finds 2 portals in front of him and N1 & N2 number of buttons are pressed in each portal controller respectively. Morty is on the Kth dimension, and wants to get to the Lth(always greater than K) dimension as soon as possible. To go from odd numbered dimensions to odd numbered dimensions, it takes 3 seconds. Same case with even to even. But whil

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