+ 1

What should I do in this code?

What is my mistake? https://code.sololearn.com/cB66JDQLN95Z/?ref=app

21st Apr 2018, 7:40 PM
Emir Dalfidan
Emir Dalfidan - avatar
2 Answers
+ 4
Just add; i=1; after res=0; then the code will work as intended, at least for the first 4 perfect numbers, since the playground will timeout before your loop can reach the next one.
22nd Apr 2018, 12:39 AM
ChaoticDawg
ChaoticDawg - avatar
+ 4
It would help to reset res and i each time through the outer loop.
21st Apr 2018, 7:48 PM
John Wells
John Wells - avatar