NewThe Learning module is now liveSee what's new

You are given a one-dimensional board represented as an array of tiles start. Each tile is one of three values: "R" (red), "B" (black), or "_" (empty). Red tiles can only move to the right; black tiles can only move to the left. In a single move, a tile can either:

  1. Slide into an adjacent empty space in its allowed direction, or
  2. Jump over exactly one tile of the opposite color into an empty space in its allowed direction.
Test Cases
Input
Output
Expected