input: def findMaxValue(nested_dict):
      """
      Find the maximum value within a nested dictionary recursively.
      
      >>> sample_dict = {
      ...     "key1": {
      ...         "value1": 10,
      ...         "value2": 20
      ...     },
      ...     "key2": {
      ...         "value3": 40
      ...     },
      ... }
      >>> findMaxValue(sample_dict)
      40
      """
      max_val = None
      for key, value in nested_dict.items():
          if isinstance(value, dict):
              max_val = max(findMaxValue(value), max_val, default=max_val)
          else:
              max_val = max(value, max_val, default=max_val)
      return max_val
output:     max_val = None
      for key, value in nested_dict.items():
          if isinstance(value, dict):
              max_val = max(findMaxValue(value), max_val, default=max_val)
          else:
              max_val = max(value, max_val, default=max_val)
      return max_val