about | help | code help+videos | done | prefs |
An array of integers 'nums' is passed in. Return an array that has the lowest number from 'nums' in index zero and the highest number from 'nums' in index one. For example, if 'nums' = {-125, 235, 453, -3528, 127, 221, -405} you would return {-3528, 453} because -3528 was the lowest number in the array and 453 was the highest number in the array. If 'nums' is empty, return zeros in both indices of the resulting array. If 'nums' only contains one number, return that number in both indices of the resulting array. Look at the test data for further examples. quiz2022_02_24_APSLHL_lowHigh([-125, 235, 453, -3528, 127, 221, -405]) → [-3528, 453] quiz2022_02_24_APSLHL_lowHigh([]) → [0, 0] quiz2022_02_24_APSLHL_lowHigh([5]) → [5, 5] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 260
Copyright Nick Parlante 2017 - privacy