You are viewing a single comment's thread. Return to all comments →
Hi Jason I kind of did the same thing what you did but mine didn't pass the test cases how whats the difference
import time
start_time = time.time()
def chocolateFeast1(he_has,cost,wrapper):
current_chocates = int(he_has / cost) current_wrappers = current_chocates while current_wrappers >= wrapper: current_chocates += 1 current_wrappers -= cost current_wrappers += 1 print(f"Took { time.time() - start_time}") print (current_chocates)
start_time = time.time() def chocolateFeast(cash, cost, wrapper_cost):
chocolate = cash//cost wrappers = chocolate while wrappers // wrapper_cost > 0: new_chocolate = wrappers // wrapper_cost wrappers -= new_chocolate * wrapper_cost wrappers += new_chocolate chocolate += new_chocolate print(f"Took { time.time() - start_time}") print (chocolate)
Seems like cookies are disabled on this browser, please enable them to open this website
Chocolate Feast
You are viewing a single comment's thread. Return to all comments →
Hi Jason I kind of did the same thing what you did but mine didn't pass the test cases how whats the difference
import time
start_time = time.time()
def chocolateFeast1(he_has,cost,wrapper):
start_time = time.time() def chocolateFeast(cash, cost, wrapper_cost):