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.
you helped me. Thanks
And I like how I was stuck this whole time until I read your comment. My code kept getting timed out because of these summations.
Thanks mate !
I agree, some of the Kata's are really easy in some languages and rediculously hard in other langauages.
It is a shame that kata ranks can be language dependent.
@Adrian1707 Well, Thanks Adrian for posting
Check the scope of all your variables. Behaviour like this usually indicates some value is persisting between method calls.
I know that it is a bit harder in SQL, but the rank is for the kata itself, not for a specific language. Also, I don't choose the rank FYI (it's the moderator - in this case adrian.eyre).
It seemed fine to me with a simple swap.
Make sure you aren't mutating the input array.
Fixed
Is this really an
issue
? I'd suggest that you take a look at this. It provides a coupleflatten
functions for you.This comment is hidden because it contains spoiler information about the solution
I assume you're using bruteforce/permutations approach, it was my first idea too. But actual solution turned out to be suprisingly (to me, at least) less complicated.
Same here. I think this Kata expects an efficient solution which would probably require a mathematical trick or two.
Use (GitHub flavored) markdown:
That being said, try your function on
9999999999
on your machine.Which language, which code? Add your code with spoilers. If it's python, do you use Python3 on your machine? Codewars uses Python2. Keep in mind that Python2's
range()
will actually create the whole list, whereasxrange
act (mostly) the same as Python3'srange
.Loading more items...