๐ Chess Piece Choreography Challenge
Imagine you're directing a synchronized chess performance where multiple pieces must move simultaneously across an 8ร8 chessboard without colliding! You have n chess pieces (rooks, queens, or bishops) at different starting positions, and you need to count how many different ways they can all move at once without crashing into each other.
The Rules:
- Rooks move horizontally or vertically (4 directions) โโโโ
- Queens move in any direction (8 directions) โโโโโโโโ
- Bishops move diagonally only (4 directions) โโโโ
Movement mechanics: All pieces start moving at time 0 and travel one square per second toward their chosen destinations. You can even choose a piece's current position as its destination (staying put).
Goal: Count all valid move combinations where no two pieces occupy the same square at any point in time during their journeys.
Input: Array of piece types and their 1-based starting positions
Output: Number of valid simultaneous move combinations