code for the algorithams from the website "https://www.hackerrank.com"