ClueLess Rishi Answer in Python
Source Code
num = list(map(int,input()))
ans = []
cou = 0
num.append(0)
for i in num:
if i == 1:
cou += i
else:
ans.append(str(cou))
cou = 0
print("".join(ans))
Source Code
num = list(map(int,input()))
ans = []
cou = 0
num.append(0)
for i in num:
if i == 1:
cou += i
else:
ans.append(str(cou))
cou = 0
print("".join(ans))
Comments
Post a Comment