Next Permutation Leetcode Python Solution