#3283
Maximum Number of Moves to Kill All Pawns
master · 1890 · lc hard +32 · 33.7% accepted · 144 likes · top 11%
Description
A 50x50 chessboard has a knight at (kx, ky) and pawns at positions. Alice and Bob alternate (Alice first). Each turn the current player picks a pawn and moves the knight to capture it using the fewest moves. Alice maximizes total moves; Bob minimizes. Return the maximum total moves Alice can guarantee.
Code
1
2
3