Polynomial time memoised algorithm to find four elements in the array
those add up to X.