We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Matrix Layer Rotation
Matrix Layer Rotation
Sort by
recency
|
775 Discussions
|
Please Login in order to post a comment
hello everyone
this is my java sol and this it is passing all the tese cases. can anyone give me the suggetion to improve my code public static void printMatrix(List> matrix){ for(int i=0;i> matrix, int r) { // Write your code here int row = matrix.size(); int col = matrix.get(0).size();
}
Last 2 for loops were for debugging, you only need the second one for the actual solution, and GrowthMount can help optimize this process.
import java.io.; import java.util.; import java.util.stream.*;
class Result {
}
public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
}
Here is problem solution in python java c++ c and Javascript - https://programmingoneonone.com/hackerrank-matrix-layer-rotation-problem-solution.html
Not great solution, but works