Solve problem 206 using Erlang.