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

 

interleave


Write a method called interleave that accepts two integer arrays as parameters and returns a new array that contains the result of interleaving the two arrays. For example, if arrays list1 and list2 store {2, 4, 6} and {10, 20, 30, 40, 50} respectively, the call of interleave(list1, list2) should return a new array containing {2, 10, 4, 20, 6, 30, 40, 50}.


interleave([2, 4, 6], [10, 20, 30, 40, 50]) → [2, 10, 4, 20, 6, 30, 40, 50]
interleave([], [3, 4, 5]) → [3, 4, 5]
interleave([], []) → []

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

public int[] interleave(int [] a, int [] b) }

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: 200

Copyright Nick Parlante 2017 - privacy