You are viewing a single comment's thread. Return to all comments →
Why is my code in Python 3 not correct?
def cookies(k, A): A.sort() c = 0 while (A[0] < k): if len(A) == 1: return -1 c += 1 v = A[0] + 2*A[1] if v >= k: A.append(v) A.pop(0) else: A[1] = v A.pop(0) return c
Seems like cookies are disabled on this browser, please enable them to open this website
Jesse and Cookies
You are viewing a single comment's thread. Return to all comments →
Why is my code in Python 3 not correct?