# C++: Find Longest Sequence of Numbers in An Unsorted Array

Given an unsorted array, find the length of the longest sequence of consecutive numbers in the array.

```
$ g++ -std=c++11 ./FindLongestSequence.cc
$ ./a.out
4
```

Reference

Written with StackEdit.

Categories

Advertisements