ROSALIND|3SUM (3SUM)
給定 k 個長度為 n 的整數數列,求各數列裡總和為零的三個數字的位置。若存在多組解,則以自位置順序以最靠前的為準。
Given: A positive integer $k \leq 20$, a positive integer $n \leq 10^4$, and $k$ arrays of size $n$ containing integers from $-10^5$ to $10^5$.
Return: For each array $A[1..n]$, output three different indices $1 \leq p < q < r \leq n$ such that $A[p] + A[q] + A[r] = 0$ if they exist, and
"-1"
otherwise.