You are viewing a single comment's thread. Return to all comments →
Thanks.Implementation in python:
#!/bin/python3 import sys if __name__ == "__main__": ans=0 q = int(input().strip()) for a0 in range(q): s = input().strip() ans=0 a="" for i in range (int(len(s)/2)): a="" a=a+s[0:i+1] #print("initial a",a) x=int(a) y=x while(len(a)<len(s)): #x=int(x) a=a+str(x+1) # print(a) x=x+1 if(a==s): ans=1 break if ans==1: print("YES",y) else: print("NO")
Seems like cookies are disabled on this browser, please enable them to open this website
Separate the Numbers
You are viewing a single comment's thread. Return to all comments →
Thanks.Implementation in python: