a hacker rank problem solved