목록Two pointers (2)
취미가 좋다
https://leetcode.com/problems/next-permutation/ Next Permutation - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Solution class Solution: def nextPermutation(self, nums): temp = [] for idx in range(len(nums)-1, 0, -1): if nums[idx] nums[idx-1]: temp[i], nums[idx-1] = nums[idx-1],..
https://leetcode.com/problems/rotate-array/ Rotate Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate ..