+ 2
CHALLENGE
The numbers numerated from 1 to N will cross a hall with doors also mumerated from 1 to N. Each number will change the state of the doors numerated with its multiples, closing the ones that were opened and opening the ones that were closed (initially they are all closed). For instance, when the number one crosses the hall, it opens all of the doors; when number two crosses it, the doors with even numbers will close. The input will be the integer N (1<=N<=25*10^6) and the output the opened doors in the end.
3 Answers
+ 1
it the input is 3 for instance, the only opened door at the end of the proccess will be "1"; however if the input is 5; the output will be "1 4", bc 1 and 4 will be opened at the final of the proccess. I don't want it to show time limot exceded when the input is 25*10^6
+ 1
my practice on python https://code.sololearn.com/cO15Dy8VcO34/#py
plus I'll get until where I got time limit exceded āŗ
until 3200 doors on mobile