Next Permutation Problem In Leetcode Python