input: def findMaxSum(limit: int, array: List[int]) -> int:
      """ Finds the maximum sum of an array of non-negative integers that does not exceed a given upper limit value.
      >>> findMaxSum(10, [1, 3, 5, 4, 2, 6])
      10
      >>> findMaxSum(8, [1, 3, 5, 4, 2, 6])
      8
      """
output:     array.sort(reverse=True)
      current_sum = 0
      for num in array:
          if current_sum + num <= limit:
              current_sum += num
          if current_sum == limit:
              break
      return current_sum