add an O(n) worst case time complexity solution to longest consecutive sequence