add lc permutations II (use a boolean vector to record the visited
index)