code: def longest_increasing_subsequence_1(nums):
      n = len(nums)
      if n == 0:
          return 0
      dp = [1 for i in range(n)]
      max_val = 1
  
      # run dp
      for i in range(n):
          for j in range(i):
              if nums[j] < nums[i]:
                  dp[i] = max(dp[i], dp[j] + 1)
                  max_val = max(max_val, dp[i])
  
      # find the values (there could be more combinations/solutions)
      current_val = max_val
      result = [0 for i in range(current_val)]
      # start from the back and look for the biggest value in dp list
      for i in range(n - 1, -1, -1):
          if (dp[i] == current_val) and (
              (len(result) == current_val)
              or (result[current_val] > nums[i])
          ):
              current_val -= 1
              result[current_val] = nums[i]
  
      return result
  
label_desc: Use image node_id 1 for calling a global function with example usage: longest_increasing_subsequence_1(nums) and returns: result, int