Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Symmetric-difference/Wren/symmetric-difference.wren
Normal file
11
Task/Symmetric-difference/Wren/symmetric-difference.wren
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import "/set" for Set
|
||||
|
||||
var symmetricDifference = Fn.new { |a, b| a.except(b).union(b.except(a)) }
|
||||
|
||||
var a = Set.new(["John", "Bob", "Mary", "Serena"])
|
||||
var b = Set.new(["Jim", "Mary", "John", "Bob"])
|
||||
System.print("A = %(a)")
|
||||
System.print("B = %(b)")
|
||||
System.print("A - B = %(a.except(b))")
|
||||
System.print("B - A = %(b.except(a))")
|
||||
System.print("A △ B = %(symmetricDifference.call(a, b))")
|
||||
Loading…
Add table
Add a link
Reference in a new issue