Task
Given two sets A and B, compute 



(
A
∖
B
)
∪
(
B
∖
A
)
.


{\displaystyle (A\setminus B)\cup (B\setminus A).}



That is, enumerate the items that are in A or B but not both. This set is called the symmetric difference of A and B.

In other words: 



(
A
∪
B
)
∖
(
A
∩
B
)


{\displaystyle (A\cup B)\setminus (A\cap B)}

 (the set of items that are in at least one of A or B minus the set of items that are in both A and B).

Optionally, give the individual differences (



A
∖
B


{\displaystyle A\setminus B}

 and 



B
∖
A


{\displaystyle B\setminus A}

) as well.



Test cases
A = {John, Bob, Mary, Serena}
B = {Jim, Mary, John, Bob}



Notes
 If your code uses lists of items to represent sets then ensure duplicate items in lists are correctly handled. For example two lists representing sets of a = ["John", "Serena", "Bob", "Mary", "Serena"] and b = ["Jim", "Mary", "John", "Jim", "Bob"] should produce the result of just two strings: ["Serena", "Jim"], in any order.
 In the mathematical notation above A \ B gives the set of items in A that are not in B; A ∪ B gives the set of items in both A and B, (their union); and A ∩ B gives the set of items that are in both A and B (their intersection).


 
redim shared as string Result(-1)   'represent our sets as strings;
                                'this'll do to illustrate the concept
 
sub sym( A() as string, B() as string )
    dim as integer ai, bi, ri
    dim as boolean add_it
    for ai = lbound(A) to ubound(A)
        add_it = true
        for bi = lbound(B) to ubound(B)
            if A(ai) = B(bi) then 
                add_it=false
                exit for    'if item is common to both lists, don't include it
            end if
        next bi
        if add_it then
            for ri = 0 to ubound(Result)
                if A(ai) = Result(ri) then 
                    add_it=false
                    exit for
                    'if item is already in the result, don't include it again
                end if
            next ri
        end if
        if add_it then
            redim preserve as string Result(0 to ubound(Result)+1)
            Result(ubound(Result)) = A(ai)
        end if
 
    next ai
end sub
 
dim as string A(0 to 3) = {"John", "Bob", "Mary", "Serena"}
dim as string B(0 to 4) = {"Jim", "Mary", "John", "Bob", "Jim"}
                             'contains a double to show code can handle it
 
 
sym(A(), B())
sym(B(), A())
 
for i as uinteger = 0 to ubound(Result)
    print Result(i)
next i
 