solutions to programming pearls problems