My problem is as follow, and is more about maths than programming I think. JavaScript is used here.
I have 3 arrays, let’s say :
a = [1, 2, 3]
b = [2, 3, 4]
c = [1]
How could I obtain the following result :
a = [2] (or [3] whatever)
b = [3] (or [4] whatever)
c = [1]
taking into account than if I just randomly set 1 and 2 in the first ones, C would be empty and none should be ?
I tried different versions of Set, Map, manual iterations and stuff but I just cannot figure the right algorithm out since lunch…
Arthur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.