Add solution to problem #38

Added solution to problem #38