my code is not accepting by leet code class solution { static void rotate(int[][] arr) { for (int i = 0; i < arr.length-1; i++) { for (int j = i; j < arr.length; j++) { int temp = arr[i][j]; arr[i][j] = arr[j][i]; arr[j][i]=temp; } } for (int i = 0; i < arr.length; i++) { int left = 0; int right = arr[0].length - 1; while (left < right) { int temp = arr[i][left]; arr[i][left] = arr[i][right]; arr[i][right] = temp; left++; right--; } } } } Line 7: error: cannot find symbol [in __Driver__.java] new Solution().rotate(param_1); ^ symbol: class Solution location: class __DriverSolution__
@prathameshborse11 ай бұрын
Class Name is wrong I think.!
@SwapnilKumarSingh-xl3ge6 ай бұрын
i am getting runtime error when i am executing this code. Somebody plz look into it import java.util.*; public class Solution { public static void rotateMatrix(int [][]mat){ // Write your code here. int n=mat.length; //transpose of the matrix for(int i=0;i