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

Java > Array-1 > maxTriple
prev  |  next  |  chance

Given an array of ints of odd length, look at the first, last, and middle values in the array and return the largest. The array length will be a least 1.

maxTriple({1, 2, 3}) → 3
maxTriple({1, 5, 3}) → 5
maxTriple({5, 2, 3}) → 5

...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-1

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

Copyright Nick Parlante 2006-10 - privacy