input: def harshad_digit_sum(x: int) -> int:
      """
      A number is termed as Harshad if it can be divided by the sum of its digits. Given an integer x, return the sum of its digits if x qualifies as a Harshad number; otherwise, return -1.
  
      Examples:
      >>> x = 18
      9
      >>> x = 23
      -1
  
      Constraints:
      1 <= x <= 100
      """
output:     digit_sum = sum(int(digit) for digit in str(x))
      if x % digit_sum == 0:
          return digit_sum
      else:
          return -1