Infosys interview question

Written test had difficult puzzles