You are viewing a single comment's thread. Return to all comments →
def separateNumbers(s): if s[0] == '0' or len(s) == 1: print('NO') return for i in range(1, len(s) // 2 + 1): x = int(s[:i]) beautiful_number = str(x) while len(beautiful_number) < len(s): x += 1 beautiful_number += str(x) if beautiful_number == s: print('YES', s[:i]) 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 →