id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > quiz2022_02_24_APSLHL_lowHigh
prev  |  next  |  chance

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)

public int[] quiz2022_02_24_APSLHL_lowHigh(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 260

Copyright Nick Parlante 2017 - privacy