Longest Consecutive Sequence
Longest Consecutive Sequence: Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example…
Longest Consecutive Sequence: Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example…
Find the Duplicate Number: Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated…
Find All Numbers Disappeared in an Array: Given an array nums of n integers where nums[i] is in the range [1,n], return an array of all the integers in the…
Remove Nth Node From End of List: Given the head of a linked list, remove the nth node from the end of the list and return its head.
Remove Duplicates from Sorted List: Given the head of a sorted linked list, delete all duplicates such that each element appears only once.
Remove Linked List Elements: Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.