code for hackerrank tasks