3SUM algorithm java implementation