18. Next Permutation
Given an integer array nums, return its next lexicographically greater permutation.
Return the adjusted nums array for the current judge. The original LeetCode problem requires an in-place update.
範例 1:
輸入: nums = [1,2,3] 輸出: [1,3,2]
範例 2:
輸入: nums = [3,2,1] 輸出: [1,2,3]
限制條件:
1 <= nums.length <= 100