You are viewing a single comment's thread. Return to all comments →
Python:
def separateNumbers(s): n = len(s) if n == 1 or s[0] == 0: return 'NO' mid = n//2 i = 0 while i < mid: temp = initial = s[:i+1] step = int(temp) while len(temp) < n: temp += str(step+1) step += 1 if temp == s: return 'YES ' + initial else: i += 1 return '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 →
Python: