Back to problems

Reversi Move Simulation

Algorithm · Hudson River Trading · Medium

(This problem is a variation of the well-known "Check if Move is Legal" exercise. If you have not solved that exercise before, it is recommended to solve it first.) You are simulating one move in the board game Reversi on an n x n board. Each cell of board contains one of 'B', 'W', or '.'. A 'B' means a black piece, a 'W' means a white piece, and a '.' means the cell is empty. You are given row, col, and player, and you must return the board after trying to place player at…

Checking your access…