H&R Block Interview Question

Simple two pointer and another LC medium question on string