Implemented a variant of 2-SUM algorithm using a sorted vector.