Solution for problem #14
Two solutions for problem #16