first and second. Build a single string by taking letters in turns: the first letter of first, the first letter of second, the second letter of first, the second letter of second, and so on.
Once one string runs out, append whatever is left of the other one unchanged. Return the resulting string.first="cat", second="dog" → 'cdaotg'
Taking turns: c, d, a, o, t, g gives cdaotg.
first="hi", second="there" → 'htihere'
After h, t, i, h the first word runs out, so the rest of the second, ere, is appended as is: hthiere.
first="sun", second="" → 'sun'
first="cat", second="dog"
'cdaotg'
Run checks the first 3 tests in your browser. Submit checks all 92 tests on the server, hidden ones included.