find three terms which sum to zero in an array