good update with !![] to get 1s, but template literal really looks like cheating
still good improvement
Shortened previous kata with template literals, and true/false Arrays converted into 1's & 0's
That's awesome!
I came across this which inspired me to experiment with it. https://www.kaggle.com/chefele/scripts-first-try
Faster than my attemp, damn that's insane...
both answer is correct.
also found that @FArekkusu's function returns primes < n. It would fail at n = 7, n = 17, etc.
I just had a quick look and yeah, it's basically the same. Just that @FArekkusu used a more efficient approach (subscript assignment to the list a thereby replacing the for loop you used in yours) to implement it.
a
for
Wait...that's just my starting algorithm!
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
And here he comes to steal the show.. lol. Nice work here. I'm trying to wrap around the algorithm. Kindly explain. Thanks!
Ordered by speed:
[deleted]
Loading collection data...
good update with !![] to get 1s, but template literal really looks like cheating
still good improvement
Shortened previous kata with template literals, and true/false Arrays converted into 1's & 0's
That's awesome!
I came across this which inspired me to experiment with it.
https://www.kaggle.com/chefele/scripts-first-try
Faster than my attemp, damn that's insane...
both answer is correct.
also found that @FArekkusu's function returns primes < n. It would fail at n = 7, n = 17, etc.
I just had a quick look and yeah, it's basically the same. Just that @FArekkusu used a more efficient approach (subscript assignment to the list
a
thereby replacing thefor
loop you used in yours) to implement it.Wait...that's just my starting algorithm!
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
And here he comes to steal the show.. lol.
Nice work here. I'm trying to wrap around the algorithm. Kindly explain. Thanks!
Ordered by speed:
So, yes, this one is the quickest.
[deleted]
[deleted]
Loading more items...