1768. Merge Strings Alternately
Practice Merge Strings Alternately for free on NudgeCode: Easy, Two Pointers pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Build a new string by taking letters from word1 and word2 in turn, starting with word1. When one word runs out, append the rest of the other word.
Example
word1 = "abc", word2 = "pqrs" -> "apbqcrs"
Constraints
- 1 <= word1.length, word2.length <= 100
- Both words have only lowercase English letters