You are viewing a single comment's thread. Return to all comments →
def buildBeautifulString(firstDigit,size): bstring = str(firstDigit) i=0 while len(bstring) < size: i+=1 bstring += str(firstDigit+i) return bstring def separateNumbers(s): result = "NO" for i in range(len(s)//2): if s == buildBeautifulString(int(s[:i+1]), len(s)): result = f"YES {s[:i+1]}" break print(result)
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 →