Ad
  • Default User Avatar

    The regex can be written in more simple way.

  • Default User Avatar

    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().

  • Default User Avatar

    oh, ya're right.

  • Custom User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    it's unreadable :(

  • Default User Avatar

    recursion is not good if the size of figures will be enourmous and the difference between sides.