Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I have a list like the following:

 {{1, 3}, {2, 5}, {3, 6}, {2, 4}}

I want the final list to be like that :

{{1, 3}, {2, 5}, {3, 6}}.

Here the first element of the sub list is needs to check with other sub list's first element and remove the sub list where first element repeated again.

So the final list doesn't have {2,4} because 2 is repeated twice.

share|improve this question

marked as duplicate by Simon Woods, Sjoerd C. de Vries, m_goldberg, Oleksandr R., Michael E2 Jun 25 '13 at 18:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

look here, similar one + sorting:… – Kuba Jun 25 '13 at 9:04
@Mr.Wizard Why has my flag counter been reset??? – Artes Jun 25 '13 at 22:08
@Artes Now that you mention it, I see that its totally gone from my profile page. – Sjoerd C. de Vries Jun 25 '13 at 22:20
Closely related: – Mr.Wizard Jun 25 '13 at 22:25
@Artes The flagging system is undergoing some major overhaul (esp. in the backend... not sure how much of it we'd actually see). Some of those involve what flags actually reach the mods and what should be left to the community to decide (e.g. off-topic flags). So such counter resets might occur temporarily as they make changes. Don't worry, they're only temporary caching effects and not permanent (cc @Sjoerd) – R. M. Jun 26 '13 at 17:44
up vote 7 down vote accepted

You can use many functions, but the most straightforward approach uses DeleteDuplicates with a test function:

DeleteDuplicates[ {{1, 3}, {2, 5}, {3, 6}, {2, 4}}, First @ #1 == First @ #2 &]
{{1, 3}, {2, 5}, {3, 6}}
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.