Cppreference Next Permutation Leetcode 312