Question: java Write a static method rotateMatrix which takes as inputs: 1- A 2D array m 2- A 1D array a. The method should then return
java


Write a static method rotateMatrix which takes as inputs: 1- A 2D array m 2- A 1D array a. The method should then return the 2D array where each row has been rotated x positions to the right. The amount of rotation positions x is provided by the 1D array values Example if the 1D array a is: And the 2D array m is: 4 16 9 4 12 6 The first row [1.4,9,16,9] should be rotated 1 position to the right, the second row [5.7.1.3.8] should be rotated 2 positions to the right, and the third row [2,4.12.6.3] should be rotated 4 positions to the ight returned array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
