CPP Permutations

If we take an output array, will we still need backtracking?

@aiman.mumtaz If you would use next_permutation() to solve this this question you wouldn’t.

I don’t understand. next_permutation()???

Yeah it is a STL in C++ which provides all permutation. Do have a look at this.