You are viewing a single comment's thread. Return to all comments →
Here's my solution in python3..
My approach is make string sequences with iniital number(digits from 1 and half length) and compare it with origintal sequence..
It works..
for _ in range(int(input().strip())): s = input().strip() check = True for i in range(1,len(s)//2+1): n = int(s[:i]) if ''.join(map(str, [n+j for j in range(len(s)//i)]))[:len(s)] == s: print("YES "+str(n)) check = False break if check: 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 →
Here's my solution in python3..
My approach is make string sequences with iniital number(digits from 1 and half length) and compare it with origintal sequence..
It works..