Search
⌘K

Leetcode 777. Swap Adjacent in LR String

Given two strings of 'L', 'R', and 'X', determine if start can be transformed into result by repeatedly applying moves "XL" → "LX" (L moves left) and "RX" → "XR" (R moves right). This reduces to verifying the L/R order (ignoring X) is the same and that every L in start is not left of its target and every R in start is not right of its target.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.