Ad
  • Custom User Avatar

    You don't need to get min and max of them. If you are summing over whole array, it doesn't matter which if you reduce or reduceRight.
    sum of [-2, -1, 0, 1, 2] is the same as sum of [2, 1, 0, -1, -2]
    And you don't need fat arraow :)
    Happy coding!