Company: Amazon_3april
Difficulty: medium
Code Question 2 (Domino Coloring) In Amazon's warehouse automation systems, robotic movement paths are modeled using domino-like tiles placed on a grid. A domino is a unique 1×2 or 2×1 piece represented by an English character (lowercase or uppercase). A valid domino arrangement is represented by two strings in the array domino . Treat domino[0] as the top row and domino[1] as the bottom row of a 2 × n grid (both strings have the same length n). Each character appears exactly twice and identifies one domino. The two strings always describe a complete, non-overlapping tiling of the 2 × n grid: Vertical domino at column i if domino[0][i] == domino[1][i] . Horizontal domino spanning columns i and i+1 if domino[0][i] == domino[0][i+1] and domino[1][i] == domino[1][i+1] . Two dominoes are adjacent if they share a side in this grid (up, down, left, or right); diagonal contact does not count. Each domino can be colored using one of three colors: Red, Green, or Blue (RG