solved 6 -- erlang