Ad
  • Custom User Avatar

    I'm very interested in an explaination of the |unit| fold here. The fold in large seem super powerful, but I can't really wrap my head around it.

    When times is already sorted, why do you use max() and min() they must surely be slower than first() last() right?

    All in all the solution is good, but some portions could be simplified, imho:

    • times.len() instead of times.iter().count()
    • on avarageing is easier with .sum() on the iterator imho.
    • I personally think remainder % is better for the secs_to_string
    • on c%2 on median you already have times[c/2] so better to add times[c/2-1] to it and than divide that.
  • Custom User Avatar

    Clever, but the use of -1 from the return really makes me cringe. ;)

    Can't understand why more people doesn't take the recursive route.
    The exercise feels really made for it.