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.
that
;
is disturbing :DThere is no point in testing whether or not an absolute value is smaller than 0.
Ut oh a
;
found it's way into our beautiful Python code :oThis is a very easy to understand solution. I don't completely understand how to create regular expressions for searching specific matches so my code is about 30000 times longer. Nice work!
Great solution, runeh.
You can also ignore the Math.abs() function as in the match[1] and match[2] is just the "remembered" part of the expression and this is the number before the optional "." without the "-".
It was unfortunate that when I defined the Kata I did not foresee that people would use those methods to avoid doing the actual recursive/functional implementastion of the solution. Later I wanted to make that feature unavailable to force the right thinking patterns, but that would most likely break all other solutions already offered. So, to avoid that I kept it as is. Some people will solve it the right way and others reading the answer could compare the solutions.
Oh, right. I used all of those in the interests of not reinventing the wheel. Maybe it would also make sense to disallow
Array.forEach
andArray.reduceRight
as well.This comment is hidden because it contains spoiler information about the solution
Doh! Of course not. Ditto with lng. That would make it a bit nicer. Thanks.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
confirmation I need to learn regex.
This comment is hidden because it contains spoiler information about the solution
I like this one mainly because it separates the regex form the range test unlike the top answers (which are very clever all-reg ex solutions).
It also matches both coordinates in one go and don't mix the regex with other logic (like loops for lat and long).
All in all very readable at a glance. (Or at least that's my very humble 6kyu opinion after looking at a few of the solutions.)