Sort and two pointers scan, O(n^2), AC