You are viewing a single comment's thread. Return to all comments →
def decentNumber(n): fives3 = 0 threes5 = 0 for k in range(n//5+1): threes5 = k if (n - 5*k) % 3 == 0: fives3 = (n - 5*k)//3 break if fives3*3 + threes5*5 != n: print(-1) return string = '5'*3*fives3 + '3'*5*threes5 print(string) return
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and The Beast
You are viewing a single comment's thread. Return to all comments →