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