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.
ok here is another:
2 3 3
g (integer >= 2) which indicates the step we are looking for,
g can't be 1,
doesnt check if $(( i + $1 )) exceed $3
test case: 1 2 2
Your solution fails on this test:
in_array(["foo bar", "foo", "bar"], ["foo", "bar"])
Sorry.
'{}'.format has been deprecated for f"{n}"
Please start using spoiler flag when discussing solutions. Otherwise anyone who hasn't solved the kata can see your post in the homepage.
This comment is hidden because it contains spoiler information about the solution
Well g modifier is efficient for some cases:
{}{}{}
for instanceThis comment is hidden because it contains spoiler information about the solution
Why this is on the top ???
I'm not sure how JavaScript is currently defined in Codewars, but when this was published, it was probably ES5 which had no spread operator. Wwhat's the "best" solution can change over time, and even depends on the platform. What's best for Internet Explorer, may not be the best for Firefox. What's best for Firefox 3 years ago may not be the best today. And what was considered "difficult" to read yesterday may be considered simple today, when certain idioms have become more widely supported and used.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
At least share an analysis of the complexity of the algorithm or a real benchmarking comparsion :-)
Running twice through the arrays does not make this o(n^2), it is not very effective, but still linear. There are different aspects under which you can consider a solution as "best". Performance is only one. Sometimes input sizes are small and performance doesn't matter, then readability and simplicity matters more. Unfortunately Codewars didn't allow to rate in different categories earlier, and now only allows to rate in "best practices" and "clever" solutions. I'd like to have the former split into "best performance" and "most simple/readble". After all, if performance would be my only criterium for every little function, I would use C instead of Python.
Loading more items...