Add solution to problem #34

Added solution to problem #34