Pregunta de entrevista de H&R Block

Simple two pointer and another LC medium question on string