Problem 22 - refactored ProblemTwentyTwo class