numbers. Replace each number with the sum of its digits and return the smallest of the resulting values.numbers=[45, 302, 88] → 5
The digit sums are 4 + 5 = 9, 3 + 0 + 2 = 5 and 8 + 8 = 16. The smallest is 5.
numbers=[1000, 7] → 1
1000 has a digit sum of 1, which beats 7 even though the number itself is larger.
numbers.length ≤ 100numbers[i] ≤ 10⁹numbers=[45, 302, 88]
5
Run checks the first 3 tests in your browser. Submit checks all 111 tests on the server, hidden ones included.