Inspired by this challenge: http://www.problemotd.com/problem/pot-of-gold/