harbor run -t openthoughts/tasktrove-mix-h1-struggle-zone-v2-mix-h1-struggle-zone-1178
harbor download openthoughts/tasktrove-mix-h1-struggle-zone-v2-mix-h1-struggle-zone-1178
Your task is to find the maximum possible sum of the digits of a positive integer that does not exceed a given positive integer ( N ).
Input:
20
Output:
2
Explanation: The integer 20 has a digit sum of 2 (2 + 0).
99
18
Explanation: The maximum sum of digits for integers not greater than 99 is 18, which can be achieved with the number 99 (9 + 9).
123
6
Explanation: For integers up to 123, the number 123 (1 + 2 + 3) gives a digit sum of 6.
Place your solution in the /app/ directory. Be sure to follow standard coding practices and comment your code where necessary.
/app/