def thanos(planet: dict, finger: int) ->int:
    """ Thanos can kill half lives of a world with a snap of the finger """
    keys = planet.keys()
    for key in keys:
        if ++finger & 1 == 1:
            planet.pop(key)
    return finger
