Find Minimum and Maximum
ARRAY

Problem

Given an array of integers arr, return an array containing the minimum and maximum values in arr.

Examples

findMinMax([1, 5, 9, 15]); // returns [1, 15] findMinMax([0, 5, 8, 12]); // returns [0, 12] findMinMax([-10, -3, 2, 0, 4]); // returns [-10, 4] findMinMax([4, 4, 4, 4]); // returns [4, 4]
Loading...