HackerRank interview question

question deep about the code