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.
Very slowly =/
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hi, If you are asking why the popular solution is preferred over yours, it is probably because it is shorter and easier for an experienced developer to verify as correct. Extra intermediate variables that are only used once are often best avoided.
why is this so low :-(?? definitely best way..
So there should be an algorithm to take off the solutions that don't pass new tests, no ?
If not, it's misleading to read solutions not working anymore.
Yes they were.
This solution doesnt work because it fails for
negative numbers : 1.2.3.-7
And also for strings with more than 4 groups of number with anything other than numbers as: 1.2.3.4.z
How has this solution passed the kata ?
Maybe the tests were different at the time ?
does or(|) always go left to right with "g" ? (bc www.|\..+ doesn't touch the domain that also starts with a dot)
Hey! nadolski's explenation is much better than I could give at the moment as I'm new to regex and this one is partially taken from stack overflow and partialy changed by me!
but he wouldn't have passed the tests if there had been a flow, right?
If you add some invalid data after dot like '1.2.3.4.asdf' the total amount of valid numbers would be 4 and function will return 'true'
because of best practices
Good solution, but it must be like this: /.+//|www\.|..+/g ("\" after "www"). Because the URL "http://www4cnet.com" will reutrn 'cnet' instead of 'www4cnet'.
I think thats because of js optimization. I've also tried with .every() but I found that if I don't use an index in condition function - it is NOT called twice for [25,25], js "predicts" that if first call returned true, there no need for second check for the same value. Of course workaround with using index worked but looked ugly. So I just used .reduce() instead.
Now I guess that 'bind' is also a workaround
Loading more items...