X32: mixString

Write a function in Java that implements the following logic: Given two strings, a and b, create a bigger string made of the first character of a, the first character of b, the second character of a, the second character of b, and so on. Any leftover characters go at the end of the result.

Examples:

mixString("abc", "xyz") -> "axbycz"
mixString("Hi", "There") -> "HTihere"
mixString("xxxx", "There") -> "xTxhxexre"

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.