Company: Capital One_1july
Difficulty: medium
Warehouse Robot Commands Problem Description In a highly automated warehouse, a robot is tasked with organizing packages stored in a rectangular grid. The grid is represented as a 2D list of integers matrix , where each integer represents a package type. To manage the sorting and rearrangement, the robot follows a series of commands given as an array of strings commands . Each command instructs the robot to perform a specific operation on the matrix: "swapRows r1 r2" : swaps the elements of row r1 with the elements of row r2 . "swapColumns c1 c2" : swaps the elements of column c1 with the elements of column c2 . "reverseRow r" : reverses the elements of row r . "reverseColumn c" : reverses the elements of column c . "rotate90Clockwise" : rotates the entire matrix 90 degrees clockwise. Here, r , r1 , and r2 are integer row indices, and c , c1 , and c2 are integer column indices. Your task is to implement the sequence of commands on the matrix and return the final state of the matrix as