From 6be71d5184e45f556b77b70fe99ce28070bd7efd Mon Sep 17 00:00:00 2001 From: kmesfun Date: Mon, 14 Jan 2019 14:49:23 -0800 Subject: [PATCH] Updated array.md with a Problem I just wanted to add a problem that I got from an interview. --- algorithms/array.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/algorithms/array.md b/algorithms/array.md index 1fcf6b51..f587a574 100644 --- a/algorithms/array.md +++ b/algorithms/array.md @@ -4,6 +4,9 @@ Arrays #### Hard - Given a set of rectangles represented by a height and an interval along the y-axis, determine the size of its union. ([Solution](https://www.geeksforgeeks.org/divide-and-conquer-set-7-the-skyline-problem/)) - Given an array, find the longest arithmetic progression. ([Solution](https://www.geeksforgeeks.org/longest-arithmetic-progression-dp-35/)) +- Given an unsorted array of integers, find the length of the longest consecutive elements sequence. +- E.g.,Input: [100, 4, 200, 1, 3, 2], Output: 4 Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4. ([Solution](https://www.geeksforgeeks.org/longest-consecutive-subsequence/)) + Note: Your algorithm should run in O(n) complexity. #### Medium - Given a list of item prices, find all possible combinations of items that sum a particular value `K`. ([Solution](https://www.geeksforgeeks.org/combinational-sum/))