Pregunta de entrevista de KLA

Leetcode medium difficulty question on string