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

 

simpleMerge2


Start with two arrays of ints, A and B, each with its elements in ascending order and without duplicates. Return a new array containing the first N elements from the two arrays. The result array should be in ascending order and without duplicates. A and B will both have a length which is N or more.


simpleMerge2([1, 3, 5, 7], [2, 4, 6, 8], 4) → [1, 2, 3, 4]
simpleMerge2([1, 3, 99], [2, 6, 99], 3) → [1, 2, 3]
simpleMerge2([1, 3, 99], [3, 6, 99], 3) → [1, 3, 6]

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

public int[] simpleMerge2(int[] a, int[] b, int n) { }

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: 360 Post-solution available

Copyright Nick Parlante 2017 - privacy