HCLTech interview question

not very difficult.