A,B,C are the arrays :
A = {1,2,3,4}
B = {8,1,2,3}
C = {1,2,9,3}
Result is the uncommon values from three arrays
Result = {4,8,9}
Asking for the logic what I can implement ?
There might be some other better answers. But here is the most simple one.
I hope it helps:-
>>> a = {1,2,3,4}
>>> b = {8,1,2,3}
>>> c = {1,2,9,3}
>>> d = a & b & c
>>> print(d)
{1, 2, 3}
>>> e = a | b | c
>>> print(e)
{1, 2, 3, 4, 8, 9}
>>> f = d^e
>>> print(f)
{4, 8, 9}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments