Cull dup Curves to create planar surface

Hello!!

I have a number of curves and I want to create a boundary surface. However, there are some dup curves result in 2 joined curves instead of one closed. How can I cull duplicate curves in order to create a closed polyline?

Thanks in advance!

cull duplicate curves.gh (18.8 KB)