public LinkedList<int[]> search(int size) {


        LinkedList<int[]> mappers = new LinkedList<int[]>();

        LinkedList<int[]> s = new LinkedList<int[]>();
        s.push(new int[0]);
        int[] allNums = new int[size];
        for (int i = 0; i < size; i++)
            allNums[i] = i;

        int[] poped = new int[0];
        while (s.size() > 0) {
            int[] top = s.peek();
            boolean breakit = false;
            for (int i : allNums) {
                if (contains(top, i))
                    continue;
                int[] num = Arrays.copyOf(top, top.length + 1);
                num[num.length - 1] = i;
                if (compareto(num, poped) > 0) {
                    s.push(num);
                    if (num.length > size - 1) {
                        mappers.add(num);
                    }
                    breakit = true;
                    break;
                }
            }
            if (!breakit)
                poped = s.pop();
        }
        return mappers;
    }