Solve the hacker rank Challange Game of thrones I