list[:]1 [LeetCode] Remove Duplicates from Sorted Array 파이썬 (list[:] shallow copy) class Solution: def removeDuplicates(self, nums: List[int]) -> int: nums[:] = list(set(nums)) nums.sort() return len(nums) stackoverflow.com/questions/4081561/what-is-the-difference-between-list-and-list-in-python list[:] -> shallow-copies the list 비추가 6695에 달하는 문제 2021. 3. 29. 이전 1 다음