Search
⌘K
Leetcode 2337. Move Pieces to Obtain a String
Given two strings with 'L', 'R', and blanks where L pieces can only slide left and R pieces only right, determine whether you can transform start into target by sliding pieces into blanks. The core challenge is to verify the relative order of L/R pieces is the same and that each L in start is not to the left of its target position (and each R not to the right), which prevents illegal moves or crossings.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.