1/12
Loading...
🔄2D Array Rotation
Rotate a 2D array 90 degrees clockwise. 🎯 Key Formula: new[col][n-1-row] = old[row][col] Simply put: • row → column • column → reversed row
Loading...
Rotate a 2D array 90 degrees clockwise. 🎯 Key Formula: new[col][n-1-row] = old[row][col] Simply put: • row → column • column → reversed row
2D array rotation transforms each element to a new position following a rule. For 90° clockwise rotation, use the formula: new[col][n-1-row] = old[row][col].