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

 

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

Write a method that finds the greatest difference between any two numbers in an array of integers. Note that the array could have just one number or could even be empty. In both of these cases return zero.


smaugGreatestDifference([-30, -33, -40, -31, -35]) → 10
smaugGreatestDifference([5, 2, 17, 6, 15]) → 15
smaugGreatestDifference([7]) → 0

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

public int smaugGreatestDifference(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