The correct writing should be:
List<List<Integer>> ret = new ArrayList<List<Integer>>();
Since in this way, you can add not only ArrayList but also LinkedList to ret
The correct writing should be:
List<List<Integer>> ret = new ArrayList<List<Integer>>();
Since in this way, you can add not only ArrayList but also LinkedList to ret