Attention ! Java coders


#1

when you will see the editorial or solution, there in the solution return type for the java code is of ArrayList<ArrayList<Integer>> but it is not in the question, rather here in the question, return type type is of int[][] type.

I had solved this question within 2 or 3 minutes, but at the end, I was not able to convert ArrayList<ArrayList<Integer>> to int [][] and finally when I saw the solution with the hope that I will get to know how to convert a 2D list to 2D array, but solutions disappointed me. If anyone knows the shortest methods to convert 2D list to 2D array, please put down in the comment section. It will helpful for me. Thanks