Question: written using java I want to rotate counterclockwise according to the size of the turn, e . g . 4 3 1 2 3 4

written using java
I want to rotate counterclockwise according to the size of the turn, e.g.
43
1234
8765
will get
Round 1
2345
1876
Round 2
3456
2187
Round 3
4567
3218
my code
"import java.util.Scanner;
public class MatrixRotation {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int size = input.nextInt(); // array size of j
int turn = input.nextInt(); // number of turns of the matrix
int num[][]= new int[2][size];
for (int i =0; i <2; i++){
for (int j =0; j < size; j++){
num[i][j]= input.nextInt(); // get data
}
}"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!