You are viewing a single comment's thread. Return to all comments →
I don't know if this is good or not(O(log n)) but here is a simple Python solution.
def strangeCounter(t): lst = [1] while lst[-1] <= t: lst.append(2 * lst[-1] + 2) return lst[-1] - t
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
I don't know if this is good or not(O(log n)) but here is a simple Python solution.