Failing with empty list even though I'm returning an empty list

In the starting of function, I’ve coded as :
if(A.isEmpty()){
return solution;
}

and solution is :
public ArrayList<ArrayList<Integer>> solution = new ArrayList<ArrayList<Integer>>();

Add an empty list to it denoting an empty set. Works fine then.

Click here to start solving coding interview questions