You are viewing a single comment's thread. Return to all comments →
python3
def separateNumbers(s): k = 1 ans = False while k < len(s): n = int(s[:k]) temp, i = str(n), 1 while len(temp)<len(s): temp += str(n+i) i += 1 if temp == s: ans = True break k += 1 print(f"YES {n}" if ans else "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 →
python3