Having some major confusion regarding this particular FCC challenge + solution.
So thus far I've been having a reasonably easy time with FCC algorithm challenges, but now I've come to this one that even with a working solution, I cant understand.
So what I dont get is why the test case
sym([1, 2, 5], [2, 3, 5], [3, 4, 5])
expect this result
[1, 4, 5]
when 5 is in all arguments.
The solution given to me gives that output (and passes all test) which I also cant understand.
You are checking each element of the first argument against an array of unique values and the elements of the second argument, so why does the 5 end up in the unique values list? Shouldnt it always get skipped?
Im not sure if I dont understand symmetrical difference or the reduce() method but theres something Im missing here and I decided to post cause I really have to sleep and cant sit in gitter all day.
Submitted July 17, 2017 at 12:05AM by HarryHayes
via reddit http://ift.tt/2v81JrV