input: Write a python function to find the longest increasing subsequence in a list.
  assert longest_increasing_sequence([1, 2, 3, 2, 3, 4, 5]) == [2, 3, 4, 5]
  assert longest_increasing_sequence([5, 6, 3, 4, 8, 9, 10, 1, 2, 3]) == [3, 4, 8, 9, 10]
  assert longest_increasing_sequence([10, 9, 8, 7]) == [10]
output: def longest_increasing_sequence(arr):
      if not arr:
          return []
      
      n = len(arr)
      lengths = [1] * n
      prev_indices = [-1] * n
      
      for i in range(1, n):
          for j in range(i):
              if arr[i] > arr[j] and lengths[i] < lengths[j] + 1:
                  lengths[i] = lengths[j] + 1
                  prev_indices[i] = j
      
      max_length = max(lengths)
      max_index = lengths.index(max_length)
      
      lis = []
      while max_index != -1:
          lis.append(arr[max_index])
          max_index = prev_indices[max_index]
      
      return lis[::-1]