0

infinite loop

why is there an infinite loop if I did't put in the break? Shouldn't it only go once with the numbers in the set once only since it is a for loop https://code.sololearn.com/cEB32E4bxhxK/?ref=app

16th Aug 2019, 1:07 AM
Hoh Shen Yien
Hoh Shen Yien - avatar
1 Answer
+ 1
Nevermind, just realised I have been adding values into the set, causing it to loop over the new values again and my solution is to use another set for the second part
16th Aug 2019, 1:21 AM
Hoh Shen Yien
Hoh Shen Yien - avatar