← All problemsSign in

3968. Maximum Manhattan Distance After All Moves

You are given a string moves consisting of the characters 'U', 'D', 'L', 'R', and '_'. Starting from the origin (0, 0), each character represents one move on a 2D plane: - 'U': Move up by 1 unit. - 'D': Move down by 1 unit. - 'L': Move left by 1 unit. - 'R': Move right by 1 unit. - '_': Can be independently replaced with any one of 'U', 'D', 'L', or 'R'. Return the maximum Manhattan distanc

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