9
#SaLah Ytm
Last seen 2 years ago
Member for 3 years, 8 months, 8 days
Difficulty Normal
you can use res=''
from typing import List
def letter_queue(commands: List[str]) -> str:
Res=''
for i in commands:
i=i.split()
if i[0] =='POP':
Res=Res[1:]
else :
Res+=i[1]
return Res
More
complicated
from typing import List
def letter_queue(commands: List[str]) -> str:
Res=''
for i in commands:
i=i.split()
if i[0] =='POP':
Res=Res[1:]
else :
Res+=i[1]
return Res
More
from typing import List
def letter_queue(commands: List[str]) -> str:
Res=''
for i in commands:
i=i.split()
if i[0] =='POP':
Res=Res[1:]
else :
Res+=i[1]
return Res
More