Infosys interview question

Coding question is difficult but technical is easy.