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.
Unlike
search
anchoring the beginning of the exoression using an^
is not necessary when usingmatch
.match
is behaving likesearch
being anchored with\A
.I think it's codewars algorithm
This comment is hidden because it contains spoiler information about the solution
Problem is the way it's written. It's fitted into one liner as a some kind of flex without care of readability. It would be better to split it into at least two lines. It's not a JS code that you need to save on spaces.
This comment is hidden because it contains spoiler information about the solution
There should be "obfuscated" button for solutions like this.
At first glance it looks simple and it's kind of obvious solution. So for most people who aren't good at programming it seems like best practice. It's numbers game just like e.g. social media today.
It's not working if b=0 for any operator. Looks like test cases are badly written if this solution passed.
They vote this as best practice cause it is easy to read.
My first thought
From kata details: "The size will always be positive and will only use whole numbers."
So, you don't care about 0.
Terrible solution. This is not how you should use exceptions...
yes, but that's only because this is a subset of a more general problem. Let's apply the very same algo to something with a larger "alphabet" (=> larger set size), and this algo becomes suddenly
O(m*n)
(n: size of the array, m: size of the set/alphabet), which isn't linear anymore.n + 2 * n is still O(n)...
How this terrible solution can be Best Practice? Sometimes I don't understand how people throw votes here...