Pergunta de entrevista da empresa H&R Block

Simple two pointer and another LC medium question on string