Olivia Liu Blog

Hello world to all the glorious developers.

Leetcode 21. Merge Two Sorted Lists

Lintcode 165. 合并两个排序链表

Description Intersection of Two Linked Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 将两个排序链表...

Leetcode 2. Add Two Numbers

Lintcode 167. 链表求和

Description 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 numb...

Leetcode 160. Intersection of Two Linked Lists

Lintcode 380. 两个链表的交叉

Description Intersection of Two Linked Lists Write a program to find the node at which the intersection of two singly linked lists begins. 请写一个程序,找到两个单链表最开始的交叉节点。 Notes: If the two linked l...

Leetcode 83. Remove Duplicates from Sorted List

Lintcode 112. 删除排序链表中的重复元素

Description Given a sorted linked list, delete all duplicates such that each element appear only once. 给定一个排序链表,删除所有重复的元素每个元素只留下一个。 Examples Input: 1->1->2 Output: 1->2 Input: 1->...

Leetcode 82. Remove Duplicates from Sorted List II

Lintcode 113. 删除排序链表中的重复数字 II

Description Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. 给定一个排序链表,删除所有重复的元素只留下原链表中没有重复的元素。 Examples Input: 1-&...

Leetcode 369. Plus One Linked List

Lintcode 904. 加一链表

Description Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume the integer do not contain any leading zero, except the n...

Leetcode 203. Remove Linked List Elements

Lintcode 452. 删除链表中的元素

Description Remove all elements from a linked list of integers that have value val. 删除链表中等于给定值 val 的所有节点。 Examples Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2->3-&...

Leetcode 19. Remove Nth Node From End of List

Lintcode 174. 删除链表中倒数第n个节点

Description Given a linked list, remove the n-th node from the end of list and return its head. 给定一个链表,删除链表中倒数第n个节点,返回链表的头节点。 Note: Given n will always be valid. Examples Given linked list: 1...

Leetcode 328. Odd Even Linked List

Lintcode 1292. 奇偶链表

Description Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should t...

Leetcode 237. Delete Node in a Linked List

Lintcode 372. 在O(1)时间复杂度删除链表节点

Description Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. 给定一个单链表中的一个等待被删除的节点(非表头或表尾)。请在在 O(1) 时间复杂度删除该链表节点。 Note: 1 ≤ m ≤ n ≤ leng...