Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
this is good
In theory, the complexity of this is worse than the optimal O(n). However... since this is JavaScript and it can only be correct to up to 15 digits... I guess it's practically acceptable.
how does this work? I don't understand what the function is returning.
okey thank you
This does not scale well. Have you tried any n greater than 1,000,000?
Besides, your
for
loop should start withint i = 3
obviously because this is the first divisible number by 3.Indeed, 33, 35, and 42 are struck-through, so they are not being taken into account.
There's, clearly, a mistake in the example. Considering eligible numbers (divisible by 3 or 7) must not exceed N (30 in your example), 33, 35, 42 should be excluded. Furthermore, because of that the actual sum of #1, #2, #3 must be greater, which is most obvious for #3.
I still don't understand how [[a]] extracts the first character without using spread operator o_O
ok, thanks for pointing that out
Nice!
done
Let's golf :D
This one will drop off words beyond 3-rd (e.g. double-barrelled surname divided by space instead of hyphen), so 3 extra dots seems to be a reasonable cost.
Use spoiler flag next time please.
This comment is hidden because it contains spoiler information about the solution
Loading more items...