Practice ยท 1 of 3
Private Helper
Implement int digit_sum(int n) using a static helper int digit_sum_nonneg(int n) for n >= 0; digit_sum itself handles negatives by summing the digits of the absolute value.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Organization Practice