You are viewing a single comment's thread. Return to all comments →
def separateNumbers(s): # Write your code here i=1 while i-1 < len(s)//2: d=int(s[:i]) if rec(d,s[i:]): print("YES "+s[:i]) return else: i+=1 print("NO") return def rec(d,s): l = len(str(d+1)) if len(s) < l: return False d_ = int(s[:l]) if d_ == d+1: if len(s[l:])>0: return rec(d_,s[l:]) else: return True else: return False
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 →