3sum time exceeding problem