2-Sum algorithm implemented