• + 1 comment

    If the problem statement is exactly the same, and you were asked to find the minimum, you simply loop through the array using Math.min() instead of the Math.max() in the last loop in this solution.

    HackerRank solutions.

    • + 1 comment
      [deleted]
      • + 3 comments

        The resulting array will have all M operations performed on it. We can find the max/min/mean/median/mode, whatever we want, since it's just an array of final values. I can take a look at your code (if you want to alter this solution to see why it didn't work.

        HackerRank solutions.