solve 025 by Ruby