You are viewing a single comment's thread. Return to all comments →
Python 3. The idea is to work backwards assuming that the final energy must be 0 or 1.
def chiefHopper(arr): e=0 for h in arr[::-1]: e=(e+h+1)//2 return e
Seems like cookies are disabled on this browser, please enable them to open this website
Chief Hopper
You are viewing a single comment's thread. Return to all comments →
Python 3. The idea is to work backwards assuming that the final energy must be 0 or 1.