js solution for guess-a-box