Soal
00:00

18. Next Permutation

SedangArrayGoogleMicrosoft

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.

Contoh 1:

Input: nums = [1,2,3]
Output: [1,3,2]

Contoh 2:

Input: nums = [3,2,1]
Output: [1,2,3]

Batasan:

  • 1 <= nums.length <= 100
Mode kode inti
● Tersimpan otomatisBaris 1, kolom 1