Your task is to rearrange an array, nums, containing positive integers to form the next lexicographically greater
For example, given the array
If the array is already in its highest possible order (sorted in descending order), such as
The entire operation must be completed in-place while using only a constant amount of extra memory.
Constraints:
nums.length
nums[i]
Your task is to rearrange an array, nums, containing positive integers to form the next lexicographically greater
For example, given the array
If the array is already in its highest possible order (sorted in descending order), such as
The entire operation must be completed in-place while using only a constant amount of extra memory.
Constraints:
nums.length
nums[i]