Domanda di colloquio di Morgan Stanley

2-sum problem with a few variations