input: Write a python function to find the length of the longest increasing subsequence.
  assert longest_increasing_subsequence([10, 9, 2, 5, 3, 7, 101, 18]) == 4
  assert longest_increasing_subsequence([0, 1, 0, 3, 2, 3]) == 4
  assert longest_increasing_subsequence([7, 7, 7, 7, 7, 7, 7]) == 1
output: def longest_increasing_subsequence(nums):
      if not nums:
          return 0
  
      n = len(nums)
      dp = [1] * n
  
      for i in range(1, n):
          for j in range(i):
              if nums[i] > nums[j]:
                  dp[i] = max(dp[i], dp[j] + 1)
  
      return max(dp)