Practice Number of Valid Move Combinations On Chessboard
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Number of Valid Move Combinations On Chessboard
Problem Statement
Each piece starts at its given one-based position on an 8 by 8 board. Choose a destination for every piece, possibly its starting square. Rooks move along a row or column, bishops along a diagonal, and queens along either. All pieces move simultaneously: each second, a moving piece advances one square toward its destination and stops there once reached. Count destination choices for which no two pieces occupy the same square at an integer time, including after a piece has stopped. Starting positions are distinct. Two neighboring pieces may swap squares in one second; crossing between squares does not invalidate that move.
Source: Number of Valid Move Combinations On Chessboard on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
pieces = ["rook"], positions = [[1,1]]
15
# Example 2
pieces = ["queen"], positions = [[1,1]]
22
# Example 3
pieces = ["bishop"], positions = [[4,3]]
12
Constraints
Related LeetCode Problems
Practice more problems similar to Number of Valid Move Combinations On Chessboard.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.