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

Java > Array-2 > bigDiff
prev  |  next  |  chance

Given an array length 1 or more of ints, return the difference between the largest and smallest values in the array. Note: the built-in Math.min(v1, v2) and Math.max(v1, v2) methods return the smaller or larger of two values.

bigDiff({10, 3, 5, 6}) → 7
bigDiff({7, 2, 10, 9}) → 8
bigDiff({2, 10, 7, 2}) → 8

...Save, Compile, Run

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  CodingBat  >  Array-2

Forget It! -- delete my code for this problem 206.0

Copyright Nick Parlante 2006-10 - privacy