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

 

abc1MaxDifference


Write a method that returns the difference between the highest and lowest value in an array of integers. Note that any integer is possible in the array, and the array can be of any length, including being empty. In the case of an empty array, return zero.


abc1MaxDifference([4, 7, 421, 2, 8, 63]) → 419
abc1MaxDifference([100, 200, 300, -50, -100, -20, 20]) → 400
abc1MaxDifference([]) → 0

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

public int abc1MaxDifference(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: 250

Copyright Nick Parlante 2017 - privacy