Simplify Problem59 to remove dependency on dictionary library