Pregunta de entrevista de Infosys

solve the subsequence varient problem.