To avoid using extra memory, the only way this could work is if you apply an arithmetic or logical operation as you iterate through the list. You'd need an operation that yields zero when it is applied between two same values (you want all of the duplicated values to cancel each other out). The operation would also have to be commutative and associative. There's only one operation I can think of that fits the bill, and it seems to come up when this kind of tricky problem is involved: xor.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To avoid using extra memory, the only way this could work is if you apply an arithmetic or logical operation as you iterate through the list. You'd need an operation that yields zero when it is applied between two same values (you want all of the duplicated values to cancel each other out). The operation would also have to be commutative and associative. There's only one operation I can think of that fits the bill, and it seems to come up when this kind of tricky problem is involved: xor.