Pregunta de entrevista de Cognizant

To solve a DSA question while explaining our intuition