Solve problem 188 using C++/Go/Python/Ruby.