Testcase not able to capture result correctly


#1

Test case assumes all rows are having same size of 1 element. It ignores all other elements in result rows and report result not matching expected output.

ArrayList<ArrayList<Integer>> result = new ArrayList<>();

// Logic to calculate result

// Now I am converting result to int[][] as required by method signature 
int[][] res = new int[result.size()][];

for(int i=0; i<result.size(); i++) {
	ArrayList<Integer> resultrow =  result.get(i);
	//System.out.println(resultrow.toString());
	int[] row = new int[resultrow.size()];
	for(int j=0; j<resultrow.size(); j++) {
		row[j] = resultrow.get(j);
	}
	res[i]=row;
	//System.out.println("res["+i+"]=" + Arrays.toString(res[i]));
	
}
return res;