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 are assuming the inner function always accept 2 arguments only, no more, no less...
have you used
timeit
to compare the performance of yourCounter()
solution with this one? I personally believe that your solution could be 10X slower.Time complexity is O(n^2), would not consider it as 'best practices' while there are more optimal solutions (e.g. see Counter).
Not a suggestion...?
5 undefined
Test Passed: Value == 25
5 undefined
Cached function did not return the correct result - Expected: 125, instead got: 25
I think it should have expected 25 and not 125, else what is the point of caching in this case ? or am I totally missing something ?
Performance KATA of the same as a suggestion.. thanks for the KATA BTW!
Very nice Kata, though my solution stinks but I learnt a lot, thanks to the author... /
Nevermind... my bad didn't read the instructions carefully.
Passed: 24 Failed: 0 Exit Code: 1
Shows timeout...is there a catch to the Kata that I have missed ?
I like very much ;)
You don't have to compare the value in the filter to true or false and what's most important, you shouldn't use the
==
for that as that is waaay less performant (read about coercion in JS).finally some helpful hint :)
Cheers!
Not an issue of the kata. Report it as a bug to CW: https://www.codewars.com/topics/bug-reports
This comment is hidden because it contains spoiler information about the solution
Loading more items...