I typed in the Scala solution presented during the last week of the progfun course
Added another screenshot and more links