Pregunta de entrevista de Cresce Technology Private Limited

asked DSA question which involves maths problem