Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys im starting to learn Java by myself and stumbled upon this exercise.

The zipMany() method behaves similarly to zip(), except that it has n different arrays as input. The signature is therefore int[] zipMany(int[][] arrays). Again, the numbers from the input arrays are to be inserted into the result arrays in turn. Likewise, arrays that have already been completely processed are to be skipped until all values of the input arrays have been used up. If the input array is empty, an empty array is returned.

Example: with arrays=[[1,4],[2,5],[3,6]] the result is [1,2,3,4,5,6].

Can anyone help me with the code?

What I have tried:

I have tried using the answer from https://stackoverflow.com/questions/2682053/how-to-mix-two-arrays-in-java[^] but my exercise needs me to use int[] zipMany(int[][] arrays) and i have no idea how to go about it.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900