This commit is contained in:
2026-05-23 20:29:33 +05:00
parent 8fd749fe9e
commit 9d30fc897c
6 changed files with 60 additions and 0 deletions

16
solutions/lc1768.py Normal file
View File

@@ -0,0 +1,16 @@
class Solution:
def mergeAlternately(self, word1: str, word2: str) -> str:
word3 = ""
j = i = 0
len1 = len(word1)
len2 = len(word2)
while j < len1 or i < len2:
if j < len1:
word3 += "".join(word1[j])
j += 1
if i < len2:
word3 += "".join(word2[i])
i += 1
return word3