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

 

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

Write a method that returns the difference between the highest and lowest values in an array. If the array is empty or only contains one element, return zero.


diffHighLow123([7, -4, 3, 1, 3, 5, 12, 2, 4, 1]) → 16
diffHighLow123([5]) → 0
diffHighLow123([]) → 0

...Save, Compile, Run (ctrl-enter)

public int diffHighLow123(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: 290

Copyright Nick Parlante 2017 - privacy