Cppreference Next Permutation Leetcode 31