Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Indeed I could, thanks for pointing this out.
Since you are summing number's digits the value cannot be negative. Sign is a property of the number not any of it's digits.
You are computing complete sum for every number even if that sum already exceeds the number.
For instance n=179117, In second iteration of while loop sum=176698 so you could break it here.