lo
lo copied to clipboard
fix: fix the case where the second slice has duplicate elements
Description (what this PR does / why we need it):
For the case below:
Union[int]([]int{0, 1, 2}, []int{0, 1, 2, 3, 3})
the output now is:
[0, 1, 2, 3, 3]
and should be:
[0, 1, 2, 3]
What this PR fixes (resolves / be part of):
- fix: fix the case where the second list has duplicate elements.
- feat: add memory prealloc.
- style: code format.