simple solution for a hackrk challenge