public static void main(String[] args) {
        PermutationsII p = new PermutationsII();
        int[] arr = {0, 1, 0, 0, 9};
        for (List<Integer> l : p.permuteUnique(arr)) {
            for (int i : l)
                System.out.print(i + " ");
            System.out.println();
        }
    }