LeetCode MEDIUM 777 Swap Adjacent in LR String Summary
Generated by Codex with GPT-5
Difficulty: MEDIUM
Problem: Swap Adjacent in LR String
Problem gist
The string contains three characters: L, R, and X. Think of X as an empty space. The only allowed moves are:
XL -> LX, which moves anLone position to the left.RX -> XR, which moves anRone position to the right.
Given start and end, the task is to decide whether start can become end after any number of those moves.