You are viewing a single comment's thread. Return to all comments →
python code with O(n) time and O(1) time:
def bonAppetit(bill, k, b): total = sum(bill) anas_cost = total - bill[k] even_split = anas_cost / 2 if even_split == b: print("Bon Appetit") else: print(math.floor(b - even_split))
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →
python code with O(n) time and O(1) time: