Solved LeetCode program · 175 of 1,000
#0202 · Happy Number
Original English source
Keep a shared value of 0. Keep a shared total of 0.
To digitize. Set total to 0.
Repeat while value is more than 0.
The digit is value modulo 10. Increase total by digit times digit. Set value to value divided by 10.
The start is 19. Set value to start. The steps is 0.
Repeat while value is more than 1 and steps is less than 100.
Digitize. Set value to total. Add 1 to steps.
If value is 1, show true, otherwise show false.
Expected stdout
true