An integer divisible by the sum of its digits is said to be a Harshad number. You are given an integer
x
. Return the sum of the digits ofx
ifx
is a Harshad number, otherwise, return-1
.
1 | class Solution { |
An integer divisible by the sum of its digits is said to be a Harshad number. You are given an integer
x
. Return the sum of the digits ofx
ifx
is a Harshad number, otherwise, return-1
.
1 | class Solution { |