my solution to hackerrank problems