lo icon indicating copy to clipboard operation
lo copied to clipboard

fix: fix the case where the second slice has duplicate elements

Open yafengio opened this issue 3 years ago • 0 comments

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.

Other special notes for reviewer:

yafengio avatar Mar 20 '22 12:03 yafengio