Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -1,16 +0,0 @@
|
|||
// in A but not in B
|
||||
function relative_complement(A, B) {
|
||||
return A.filter(function(elem) {return B.indexOf(elem) == -1});
|
||||
}
|
||||
|
||||
// in A or in B but not in both
|
||||
function symmetric_difference(A,B) {
|
||||
return relative_complement(A,B).concat(relative_complement(B,A));
|
||||
}
|
||||
|
||||
var a = ["John", "Serena", "Bob", "Mary", "Serena"].unique();
|
||||
var b = ["Jim", "Mary", "John", "Jim", "Bob"].unique();
|
||||
|
||||
print(a);
|
||||
print(b);
|
||||
print(symmetric_difference(a,b));
|
||||
Loading…
Add table
Add a link
Reference in a new issue