optimized [two sum]