python leetcode 31. Next Permutation

NoSuchKey