Infosys Interview Question

write a code of advanced level