Function problem solution in hacker rank

welcome to shbcf.ru