LinkedList2 Leet Code 83. Remove Duplicates from Sorted List [Easy] Problem: Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input: 1->1->2->3->3 Output: 1->2->3 -Summary- 1. Set root as head first. 2. Move the head and compare the current value with the next value. If it is the same, point next to next.next. Otherwise, move head to the next. 3. Return root -Code- # Defi.. 2020. 9. 8. LeetCode 2. Add Two Numbers [Linked List] Problem: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example: Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8 Explanation.. 2020. 6. 9. 이전 1 다음