Pregunta de entrevista de Capital One

Find the first common intersection in two stacks