Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# syntax: GAWK -f SYMMETRIC_DIFFERENCE.AWK
BEGIN {
load("John,Bob,Mary,Serena",A)
load("Jim,Mary,John,Bob",B)
show("A \\ B",A,B)
show("B \\ A",B,A)
printf("symmetric difference: ")
for (i in C) {
if (!(i in A && i in B)) {
printf("%s ",i)
}
}
printf("\n")
exit(0)
}
function load(str,arr, i,n,temp) {
n = split(str,temp,",")
for (i=1; i<=n; i++) {
arr[temp[i]]
C[temp[i]]
}
}
function show(str,a,b, i) {
printf("%s: ",str)
for (i in a) {
if (!(i in b)) {
printf("%s ",i)
}
}
printf("\n")
}