Skip to content

#1768 - Merge Strings Alternately

EasyArray / String
Open on LeetCode

Given two strings word1 and word2, merge them by adding letters in alternating order, starting with word1. If one string is longer than the other, append the remaining letters at the end.

InputOutput
word1 = "abc", word2 = "pqr""apbqcr"
word1 = "ab", word2 = "pqrs""apbqrs"
word1 = "abcd", word2 = "pq""apbqcd"

Released under the MIT License.