๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
def decodeString(self, s: str) -> str:
stack = []

for i in range(len(s)):
ch = s[i]

if ch==']':
t = ""
while len(stack)>0 and stack[-1]!="[":
t+=stack[-1]
stack.pop()
stack.pop()
count = ""
#print(stack)
while len(stack)>0 and ord(stack[-1])-ord('0')>=0 and ord(stack[-1])-ord('0')<10:
count=stack[-1]+count
stack.pop()
stemp = int(count)*t[::-1]

for i in range(len(stemp)):
stack.append(stemp[i])
else:
stack.append(ch)

return "".join(stack)