Add solution to problem #30

Added solution to problem #30