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…`

69 more words

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…`

69 more words

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. 61 more words

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. 94 more words`

Given two numbers represented by two lists, write a function that returns sum list. The sum list is list representation of addition of two input numbers. 145 more words

Remove all elements from a linked list of integers that have value val.

Example

Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6… 57 more words

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.

Do not allocate extra space for another array, you must do this in place with constant memory. 62 more words

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.

For example,

Given `1->2->3->3->4->4->5`

, return… 78 more words