Hacker rank problem solutions