input: def findMaxValue(nested_dict: dict) -> int:
      """ Find the maximum value within a nested dictionary.
      >>> findMaxValue({'key1': {'value1': 10, 'value2': 20}, 'key2': {'value3': 40}})
      40
      >>> findMaxValue({'key1': {'value1': 50, 'value2': 60}, 'key2': {'value3': 40}})
      60
      """
output:     max_value = float('-inf')
      for key, value in nested_dict.items():
          if isinstance(value, dict):
              max_value = max(max_value, findMaxValue(value))
          else:
              max_value = max(max_value, value)
      return max_value