first set of useful code for hackerrank