Domanda di colloquio di Amazon

It was a generic two-pointer problem.