My take on Hackerrank