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…
Combination Sum III: Find all valid combinations of k numbers that sum up to n such that the following conditions are true:
Find Median from Data Stream: The median is the middle value in an ordered integer list.
K Closest Points to Origin: Given an array of points where points[i] = [x_i, y_i] represents a point on the X-Y plane and an integer k, return the k closest…
Diameter of Binary Tree: Given the root of a binary tree, return the length of the diameter of the tree.