shallow copy1 [LeetCode] Remove Duplicates from Sorted List 파이썬 (Linked List, shallow copy, deepcopy) 하위 95% 솔루션 😱 64ms # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def deleteDuplicates(self, head: ListNode) -> ListNode: total = [] while head: total.append(head.val) head = head.next total = list(sorted(set(total))) print(total) answer = None for i in range(len(total)): if i == 0: answer = ListNo.. 2021. 3. 31. 이전 1 다음