HackerRank Interview Question

question deep about the code