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 comment is hidden because it contains spoiler information about the solution
I think there's a problem with author's solutions: when the key is entirely made of underscores (empty), the solution expects false.
You're right... these things are not taught at schools too much. The emergence of computing brought to light some aspects of math that were less stressed before: Graph theory, Number Theory, Combinatorics, Discrete Math etc. Usually these topics are not well adressed in schools - the highschool curriculum (in many countries) is focused on algebra, calculus and geometry, and more suitable for learning physics or economics or engineering than computers.
And how needed are those hacks? when playing competitive programming or here on this site or maybe at some job interview - these tricks are awesome going from O(n) or O(n2) to easy one liner O(1)... I doubt how needed they are in real life programming. Probably not much, and if you ever need them, google them out
The description mentions that the input has k<=700 and n<=20
But it's still possible that k+n-1 will exceed 700, and it's unclear what happens now.
Should the prime-list be extended beyond the 700th prime? (e.g. that's my solution)
or should you calculate a smaller number than expected using only the 700 primes available (e.g. author's solution) ??
OEIS A000009
This comment is hidden because it contains spoiler information about the solution
Thanks! :-)
This comment is hidden because it contains spoiler information about the solution
Please correct the 1st example - it doesn't add to 17...
toda!
I promise one day I'll get to regex, on my todo list!
Not exactly... when python creates a list (or string), it automatically saves its length. Finding the length is a single operation, not a loop through its elements. So no need to save it, and it's always O(1) complexity, no matter the length itself.
read more comments here:
https://stackoverflow.com/questions/699177/python-do-python-lists-keep-a-count-for-len-or-does-it-count-for-each-call
Nothing I can come up with... well written in all. You may have to wait for more people to finish so you'll get a better perspective. The thing with katas about games is that you have to explain in length many rules - could be deterring, but no choice for you... you have to explain. I hope many people know the game (or mancala), because it helps a lot. So I suggest that you add to the description a link to a real on-line game (like Unnamed's link / maybe something a bit more modern???) where people can play the game first.
Lovely one, very well done!! Thanks for making it :-)
ah funny I forgot to put something in there. Usually I write there a feeling or greeting "hello" or 'nice' or something... As long as it's not empty, it serves as True
Loading more items...