input: Write a python function to find the longest sequence of consecutive numbers in a given list.
  assert longest_sequence([1, 9, 3, 10, 2, 20]) == [1, 2, 3]
  assert longest_sequence([36, 41, 56, 35, 37, 39, 38, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50]) == [35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]
  assert longest_sequence([8, 9, 1, 2, 3, 4, 5, 6, 7]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]
output: def longest_sequence(nums):
      if not nums:
          return []
  
      nums_set = set(nums)
      longest_streak = 0
      best_start = None
  
      for num in nums:
          if num - 1 not in nums_set:
              current_num = num
              current_streak = 1
  
              while current_num + 1 in nums_set:
                  current_num += 1
                  current_streak += 1
  
              if current_streak > longest_streak:
                  longest_streak = current_streak
                  best_start = num
  
      return list(range(best_start, best_start + longest_streak))