A higher resolution is required to access the IDE
- 170
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
Find the winner (You have to make several assumptions:
- The given boards are legal and are assuming the official Chess rules: https://en.wikipedia.org/wiki/Rules_of_chess
- In every board there is a winner (no draws) or the board is not terminal (the game could be continued)
- An attacked King could be saved only by moving himself to a safe square (not by using another piece from the King's team)
- A safe square is defined as either an empty square not attacked by any opponent's piece, or a square occupied by an opponent's piece that is not protected by any other opponent's piece
- White pawns are moving upwards, while black pawns are moving downwards
Example board:
........
.......k
........
........
........
......R.
.K.....R
........
In this example the white rooks (uppercase
Input
Characters can be:
. - Not occupied square on the boardR - White RookN - White KnightB - White BishopQ - White QueenK - White KingP - White Pawnr - Black Rookn - Black Knightb - Black Bishopq - Black Queenk - Black Kingp - Black Pawn
Output
Constraints
Example
Input
........ .......k ........ ........ ........ ......R. .K.....R ........
Output
W
A higher resolution is required to access the IDE