Move Pieces Transformation

There are 3 types of pieces represented by characters: 'L' (left-moving piece), 'R' (right-moving piece), and '_' (empty space). Pieces can only move in their designated direction:

  • 'L' pieces can only move left
  • 'R' pieces can only move right

Given two strings start and target of equal length, determine if it's possible to transform start into target following these movement rules.

Examples
Input: ["_L__R__","L____R_"]
Output: true
Hints

Move Pieces Transformation

There are 3 types of pieces represented by characters: 'L' (left-moving piece), 'R' (right-moving piece), and '_' (empty space). Pieces can only move in their designated direction: