Pregunta de entrevista de RSK Business Solutions

Asked to solve a basic DSA string question