Add solutions to an exercise on pattern matching