input: from typing import List
  
  def find_max_good_subsequence_length(nums: List[int], k: int) -> int:
      """
      Given an integer array nums and a non-negative integer k, determine the maximum length of a subsequence where there are no more than k positions i for which seq[i] != seq[i + 1].
  
      Return the length of the longest such subsequence of nums.
  
      Examples:
      >>> nums = [1,2,1,1,3], k = 2
      4
      >>> nums = [1,2,3,4,5,1], k = 0
      2
  
      Constraints:
      1 <= nums.length <= 500
      1 <= nums[i] <= 10^9
      0 <= k <= min(nums.length, 25)
      """
output:     
      n = len(nums)
      max_length = 0
  
      for start in range(n):
          current_changes = 0
          current_length = 1
  
          for end in range(start + 1, n):
              if nums[end] != nums[end - 1]:
                  current_changes += 1
              if current_changes > k:
                  break
              current_length += 1
  
          max_length = max(max_length, current_length)
  
      return max_length
  