Happy Monday!
Today's problem involves turning a long number in to a short number. The goal is to sum each digit of the number recursively until you reach a single digit. Here are a few test cases to make it easier to understand.
123456 = 1+2+3+4+5+6 = 2+1 = 3 99 = 9+9 = 1+8 = 9
Comments:
Sami Suteria - 9 years, 6 months ago
Run with node with the argument being after the filename
$: node app.js 123456
reply permalink
Anonymous - 9 years, 6 months ago
reply permalink
Anonymous - 9 years, 6 months ago
reply permalink