Merge Strings Alternately LeetCode solution in Python
1# Runtime: 7 ms (Top 98.2%) | Memory: 13.31 MB (Top 45.5%)234class Solution(object):5def mergeAlternately(self, word1, word2):6i = 07j = 08st = []9while i < len(word1) and j < len(word2):10st.append(word1[i])11st.append(word2[j])12i += 113j += 114while j < len(word2):15st.append(word2[j])16j += 117while i < len(word1):18st.append(word1[i])19i += 120return "".join(st)