I am working on a problem in which I performed many operations on an ArrayList<int[]>
. However, the final result should be of type int[][]
. Do you have any suggestions on how to achieve this? If you have a solution that involves streams that's good for me.
Consider this example:
public static int[][] findFarmland(int[][] land) {
var result = new ArrayList<int[]>();
/**
* Here you find a code to find farm lands.
* @see LeetCode Problem : https://leetcode.com/problems/find-all-groups-of-farmland/
*/
return //array based on the ArrayList result.
}