Next Greater Permutation Leetcode Solution