hackerrank.com my solutions in Erlang