Problem 232 for AP Computer Science