You are viewing a single comment's thread. Return to all comments →
nice small code, mine is very big but passes all test case
a = [p] for i in range(1,1000000): if a[i-1]-d > m: a.append(a[i-1]-d) else: a.append(m) sum = 0 # print(a) count = 0 for i in range(len(a)): if sum <= s: sum += a[i] count += 1 print (count-1) return count-1
Seems like cookies are disabled on this browser, please enable them to open this website
Halloween Sale
You are viewing a single comment's thread. Return to all comments →
nice small code, mine is very big but passes all test case