[Algorithm] 16 week(4.25 ~ 5.01) 1/3

Dev_min·2022년 4월 25일
0

algorithm

목록 보기
50/157

83. Remove Duplicates from Sorted List

var deleteDuplicates = function(head) {
    if(head === null || head.next === null) return head;
    head.next = deleteDuplicates(head.next);
    
    if(head.val === head.next.val){
        return head.next;
    } else {
        return head;
    }
};
profile
TIL record

0개의 댓글