Solve problem 203 using Java.