+ 3

Is it possible to improve the algorithm?

Tried to solve the problem of "Sieve of Eratosthenes" in a minimum of strings. The problem is that the maximum number entered is 258. How to increase the input? https://code.sololearn.com/cKbpz1DxsUkk/?ref=app

19th Apr 2018, 11:24 PM
Anton_Time.deltaTime
Anton_Time.deltaTime - avatar
7 Réponses
+ 9
That's a limitation of the Code Playground, your code is fine. Code is given a limited amount of time to execute. A more efficient application of this algorthm (if there is one) might be able to output more in time.
20th Apr 2018, 1:51 AM
Tamra
Tamra - avatar
+ 3
Impressive! :-) I couldn't improve on your excellent work!
20th Apr 2018, 1:51 AM
Emma
+ 3
Tamra Right, I misunderstood the question I think. They were concerned about the SL Playground timeout, not literally the efficiency of the algorithm?
20th Apr 2018, 5:12 PM
Emma
+ 3
Anton_Time.deltaTime Great, understood. Like I said it looks good to me. In reality you could time different algorithms on different platforms / languages to get an idea.
20th Apr 2018, 5:41 PM
Emma
+ 2
Hmm... I'm understood, thanks! =3
20th Apr 2018, 4:28 PM
Anton_Time.deltaTime
Anton_Time.deltaTime - avatar
+ 2
Xan I guessed about the SL Playground timeout. =3 So I was concerned about the speed of the algorithm.
20th Apr 2018, 5:38 PM
Anton_Time.deltaTime
Anton_Time.deltaTime - avatar
+ 2
Xan Thanks. It is good idea. =3
20th Apr 2018, 5:46 PM
Anton_Time.deltaTime
Anton_Time.deltaTime - avatar