Jump to content

Symmetric difference: Difference between revisions

no edit summary
No edit summary
Line 2,128:
<pre>Serena Jim</pre>
 
 
=={{header|Ring}}==
<lang ring>
aList = []
bList = []
aList = ["John", "Bob", "Mary", "Serena"]
bList = ["Jim", "Mary", "John", "Bob"]
 
aList2 = []
for i = 1 to len(aList)
flag = 0
for j = 1 to len(bList)
if aList[i] = bList[j] flag = 1 ok
next
if (flag = 0) add(aList2, aList[i]) ok
next
see aList2
 
bList2 = []
for j = 1 to len(aList)
flag = 0
for i = 1 to len(bList)
if aList[i] = bList[j] flag = 1 ok
next
if (flag = 0) add(bList2, bList[j]) ok
next
see bList2 + nl
</lang>
=={{header|Ruby}}==
With arrays:
2,468

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.