#24 solution