Good morning! Here's your coding interview problem for today.
This problem was asked by Facebook.
Given a list of integers L, find the maximum length of a sequence of consecutive numbers that can be formed using elements from L.
For example, given L = [5, 2, 99, 3, 4, 1, 100], return 5 as we can build a sequence [1, 2, 3, 4, 5] which has length 5.
Good morning! Here's your coding interview problem for today.
This problem was asked by Facebook.
Given a list of integers
L, find the maximum length of a sequence of consecutive numbers that can be formed using elements fromL.For example, given
L = [5, 2, 99, 3, 4, 1, 100], return5as we can build a sequence[1, 2, 3, 4, 5]which has length5.