LeetCode 83: Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.
Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?
Given a linked list, remove the nth node from the end of list and return its head. For example,Given linked list: 1->2->3->4->5, and n = 2.
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6
, val = 6. Return: 1 --> 2 --> 3 --> 4 --> 5
.
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return 3.
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4
, you should return the list as 2->1->4->3
.
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.