Domanda di colloquio di Uber

Three Sum question from leetcode was asked