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.
The regex can be written in more simple way.
I thinkt it's better to use array then List, becuz that is written that every town has a number for every month. (there are 12 mounts always). Second note from me is that ya call parseTemp() 2 times in variance().
oh, ya're right.
Such a solution would pass the tests and be more efficient.
But it wouldn't be correct by the requirements: "Return None if it is not possible to define only one of such values".
So if the array is
[5, 3, 3, 1]
we should return 1 as closest to zero and we can only do that if we cover the whole array.If we stop for any number at equal distance to the current closest to zero we would stop for 3 and return None.
It's what dinglemouse complains about at my first solution that did what you suggested.
I think it's better to put the chance to return null sooner... if ya have 2 the same abs(integers) in the table there is no reason to compute the rest of the function.
it's unreadable :(
recursion is not good if the size of figures will be enourmous and the difference between sides.