2-SUM variant