Defined in header <algorithm> template< class BidirIt >
bool next_permutation( BidirIt first, BidirIt last ); (1) template< class BidirIt, class Compare >
bool next_permutation( BidirIt first, BidirIt last, Compare comp ); (2)
Transforms the range [first, last) into the next permutation from the set of all permutations that are lexicographically ordered with respect to operator< or comp. Returns true if such permutation exists, otherwise transforms the