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

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

Given 2 int arrays, a and b, of any length, return a new array with the first element of each array. If either array is length 0, ignore that array.

front11({1, 2, 3}, {7, 9, 8}) → {1, 7}
front11({1}, {2}) → {1, 2}
front11({1, 7}, {}) → {1}

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

Copyright Nick Parlante 2006-10 - privacy