You are given a String[] board representing a standard 8x8 chess board.
The '.' character represents an empty cell, 'P' represents a cell occupied by a pawn, and 'K'
represents a cell occupied by a king.
In a single move, a king can move to any of its 8 neighboring cells. If you move a king
into a cell occupied by a pawn, the king will capture that pawn. You can never move a
king outside the board or into a cell already occupied by another king.
Return the minimal number of moves required for the kings to capture all the pawns.
|