I have a list of Datapoints (List).
e.g
original list
(1,2)
(2,2)
(1,3)
(3,3)
(4,3)
(2,3)
(5,4)
I want a output list as
(1,2)
(2,2)
(3,3)
(4,3)
(5,4)
or
(1,3)
(3,3)
(4,3)
(2,3)
(5,4)
i.e I want to remove all the other points where X value duplicates.
One approach that I have is to loop through all the point and take the current point x value and compare it with rest of the list if it equals other points X value then remove that value.
How will I do that using LINQ or some extension method(Distinct)