Cppreference Next Permutation Leetcode 316