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
Same here! I'm getting 52/51, still don't know why!
Very nice Kata! At first it seemed impossible, but then after studying a little of the Pascal's triangle it just kind of clicked you know?
"It's array, everything is a array"
Thanks for the feedback!
Nice Kata! It was good to complete it!
This comment is hidden because it contains spoiler information about the solution
innefficient (adjective) - wasting or failing to make the best use of time or resources
Is your code making the best use of resources without wasting effort? No, it is not. Thus your code is literally the definition of inefficient. That's all I'm saying.
I'm not saying you should correct it or change it or anything else. I was just pointing out that the way the code is written it is very inefficient. You seemed to think differently so I pointed out the inefficiency with just 2 arrays. It performs worse when you add more arrays and even worse as they overlap less. I beleive the time complexity of your implementaiton is
O(n^3)
. Although I'm not 100% on that though.The kata is not about performance. I didn't say it was. I was letting you know that your solution is doing a lot of wasted effort. That is all. It was not an attack on you or your code. I was merely pointing out a fact.
I think this solution is cool and it's neat that it fits on one line.
¯\_(ツ)_/¯
Different application environments use different code.
if this is a very high performance requirements of the application environment, we should try to optimize the code to improve performance.
If not, try to streamline the code, to give the job to CPU, don't let yourself exhausted ;-)
So my conclusion is that, in codewars, as long as the code can pass all the tests will be enough.
If the author is concerned about the performance of the code, he will add some testcases about the performance.
Your sad make me so happy ;-)
You oneliner makes me sad.
I did it in 22 lines..
Not that is a competition, but you won.