Cppreference Next Permutation Leetcode 3110