def unique_array_sum_combinations(A, B, C, target):
def check_sum(n, *nums):<EOL><INDENT>if sum(x for x in nums) == n:<EOL><INDENT>return (True, nums)<EOL><DEDENT>else:<EOL><INDENT>return (False, nums)<EOL><DEDENT><DEDENT>pro = itertools.product(A, B, C)<EOL>func = partial(check_sum, target)<EOL>sums = list(itertools.starmap(func, pro))<EOL>res = set()<EOL>for s in sums:<EOL><INDENT>if s[<NUM_LIT:0>] is True and s[<NUM_LIT:1>] not in res:<EOL><INDENT>res.add(s[<NUM_LIT:1>])<EOL><DEDENT><DEDENT>return list(res)<EOL>
1. Sort all the arrays - a,b,c. - This improves average time complexity.
2. If c[i] < Sum, then look for Sum - c[i] in array a and b.
   When pair found, insert c[i], a[j] & b[k] into the result list.
   This can be done in O(n).
3. Keep on doing the above procedure while going through complete c array.

Complexity: O(n(m+p))