Add solution to problem #29

Added solution to problem #29