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.
Why do my test cases pass on an individual basis but fail as a group?
I think you've come up with a solution that is fitting the Sample test cases But not the Random Ones , So you might have omitted Calculating an Expression that leads to a greater value
also For more Help, you can post your code here under Spoiler Flag so not to reveal any pieces of information, this will allow SQL Coders to catch a bug or so , Tuned to hear from you .. regards .. Zizou
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).
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.
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, whereas xrange act (mostly) the same as Python3's range.
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...