Link: https://leetcode.com/problems/merge-strings-alternately/
Solution:
Intuition
Extremely simple problem. In some ways similar to merging 2 sorted arrays, but without the conditional check. (and only one pointer is needed).
Implementation
Review 1
Not a huge fan of the above implementation. There is no need to treat word1
so generically. Just iterate over it and add the remainder from word2
if it exists.