Pergunta de entrevista da empresa Jain Software

Question realted to algorithm.