← All problemsSign in

Command subsequence

Given a sequence of length n consisting of commands like Up(U), Right(R), Down(D) and Left(L). You are given q queries. Queries can be two type: 1 i x - Update command at index i to command x 2 sx sy dx dy - You have to move from source (sx,sy) to destination (dx,dy). Can you choose subsequence of commands such that it is possible to reach (dx,dy) from(sx,sy) For each query of type 2, you have

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