id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

Array-1 > makeMiddle
prev  |  next  |  chance

Given an array of ints of even length, return a new array length 2 containing the middle two elements from the original array. The original array will be length 2 or more.

makeMiddle({1, 2, 3, 4}) → {2, 3}
makeMiddle({7, 1, 2, 3, 4, 9}) → {2, 3}
makeMiddle({1, 2}) → {1, 2}

...Save, Compile, Run

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


prev  |  next  |  chance   |  JavaBat  >  Array-1

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

Copyright Nick Parlante 2006-09 - privacy