Merge two strings by adding letters in alternating order, starting with word1. If one string is longer, append the remaining letters to the end.
Use two pointers advancing through both strings simultaneously. Append from word1 then word2 in turns.
- Use pointers i and j starting at 0.
- While either i < word1.length or j < word2.length:
- Append word1[i] if i is valid; append word2[j] if j is valid.
- Advance both.
- Time Complexity: O(N+M)
- Space Complexity: O(N+M)