Rewrote using List<List<Integer>> instead of List<Integer>[]