Merge Strings Alternately - Leetcode 1768 - Python

preview_player
Показать описание
This video talks about solving a leetcode problem which is called Merge Strings Alternately. This question asked in many top companies.

We will see more videos on solving leetcode problems, which are asked in interviews from top companies (MAANG)

Like 👍
Share 📣
Comment 💬
Press the Bell icon🔔for updates

#python #leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

Like 👍
Share 📣
Comment 💬
Press the Bell icon🔔for updates

techerror
Автор

class Solution:
def mergeAlternately(self, word1: str, word2: str) -> str:
li=[]
for i in range(max(len(word1), len(word2))):
if i <len(word1):
li.append(word1[i])
if i <len(word2):
li.append(word2[i])
return ''.join(li)

VishnuvardhanJadava