You are viewing a single comment's thread. Return to all comments →
def separateNumbers(s): n = len(s) for l in range(1, n // 2 + 1): fir_num = int(s[:l]) cur_num = fir_num ans = str(fir_num) while len(ans) < n: cur_num += 1 ans += str(cur_num) if ans == s: print(f"YES {fir_num}") return 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 →