input: Write a function to find the maximum sum of an array of non-negative integers given an upper limit value. If the sum exceeds the limit, it should not be considered. If the array is empty, the function should return 0.
  assert findMaxSum(10, [1, 3, 5, 4, 2, 6]) == 10
  assert findMaxSum(7, [1, 3, 5, 4, 2, 6]) == 6
  assert findMaxSum(20, [1, 3, 5, 4, 2, 6]) == 21
  assert findMaxSum(5, [1, 3, 5, 4, 2, 6]) == 5
  assert findMaxSum(0, [1, 3, 5, 4, 2, 6]) == 0
  assert findMaxSum(10, []) == 0
output: def findMaxSum(limit, arr):
      max_sum = 0
      current_sum = 0
      for num in arr:
          if current_sum + num <= limit:
              current_sum += num
              if current_sum > max_sum:
                  max_sum = current_sum
          else:
              break
      return max_sum