Std::next_permutation is working


#1

just use the
next_permutation(A.begin(),A.end());