DEV Community

Discussion on: School problem from senior developer interview

Collapse
 
rodiongork profile image
Rodion Gorkovenko

Nice idea about finding "the loop length" after which "endings" repeat :) Perhaps some other puzzle could be invented from it.

However my approach was simpler - just taking modulo by 10eX where X is amount of digits in the number we seek. Then numbers won't grow longer than this.

I suspect your and mine approaches are really two versions of the same fact, however