Linked List, Easy
Question
Given a sorted linked list, delete all duplicates such that each element appear only once.
Example 1:
|
|
Example 2:
|
|
Answer
|
|
Recursive
|
|
Running time: O(n)
Anne.github.io
Given a sorted linked list, delete all duplicates such that each element appear only once.
Example 1:
|
|
Example 2:
|
|
|
|
|
|
Running time: O(n)