Cppreference Next Permutation Leetcode 311001