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

 

apcsaArraysSmallInterleave


Given two arrays even and odd, each with exactly two elements, create and return a new array which interleaves the elements from even with the elements from odd, into the even and odd index positions of the result.


EXAMPLE

even: {0, 1} (note these values do not need to be even numbers, that's not what the parameter name is about)

odd: {3, 2}

output: {0, 3, 1, 2}

apcsaArraysSmallInterleave([0, 1], [3, 2]) → [0, 3, 1, 2]
apcsaArraysSmallInterleave([2, 4], [1, 3]) → [2, 1, 4, 3]
apcsaArraysSmallInterleave([0, 0], [1, 1]) → [0, 1, 0, 1]

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

public int[] apcsaArraysSmallInterleave(int[] even, int[] odd) { }

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

Copyright Nick Parlante 2017 - privacy