← All problemsSign in

Venkat And His Commute

Venkat commutes on a 2D plane in order to reach his office. He can go either up or right. He thinks that his current route is too long and he wants to make it as short as possible. You are given a sequence of Venkat's moves. In the given sequence moving up is described by character $U$ and moving right is described by character $R$. Venkat can replace any pair of consecutive moves $RU$ or $UR$ wi

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