X339: arrayFromTwoStrings

Given two strings of equal length, return an array of char values that contains the characters of the strings in alternating order. For example, if the first string is "Pure" and the second string is "Java", the resulting array will contain the characters {'P', 'J', 'u', 'a', 'r', 'v', 'e', 'a'}. If the two strings are not of equal length, return an array of length 0.

Examples:

arrayFromTwoStrings("Pure", "Java") -> {'P', 'J', 'u', 'a', 'r', 'v', 'e', 'a'}

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.