Prune duplicates from sublists

Please Help!
I’m trying to create some shortest point-point connector script but I cant figure out how to remove duplicate points from sublists without flattern it.

After burning my head with the problem I’ve give up. Can some one help, please.
I thint that this is really easy for people used list - logic

Please see Atached image.

In your example do you want to connect the ten random points with z=1 with the closest 10 random points (out of 50) with z=0, without having multiple points “finding” the same closest point, e.g. many to one?

Yes, exactly, here is what it does:
Duplicates results connecting to same point.

If this is the result you’re after:

I suggest that you try this: (this is done in Dynamo 1.2)