input: Write a function to find the length of the longest increasing subsequence in an array.
  assert optimize([10, 22, 9, 33, 21, 50, 41, 60, 80]) == 6
  assert optimize([3, 10, 2, 1, 20]) == 3
  assert optimize([3, 2]) == 1
output: def optimize(arr):
      if not arr:
          return 0
      n = len(arr)
      lis = [1] * n
      
      for i in range(1, n):
          for j in range(i):
              if arr[i] > arr[j]:
                  lis[i] = max(lis[i], lis[j] + 1)
      
      return max(lis)