• + 0 comments

    PY

    Simple code:

    def strangeCounter(t):
        start_value = 3
        while  start_value - 2 <= t:
            start_value *= 2
        return start_value - 2 - t