Infosys Interview Question

Prime number Man with sword puzzle