Question: I have a list like:

```
   {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, 
    {{4, 18}, 1}, {{4, 14}, 3},  {4,15},      {{4, 16}, 2},{4,18}}

```

Now I want to filter this list. First I want to delete lists that have the form: 
`{a,b}` like `{4,15}` and `{4,18}`. So what remains is:

```
 {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, 
  {{4, 18}, 1}, {{4, 14} ,3}, {{4, 16}, 2}}

```

And now I want only the lists which are a minimum:
For example now you have a list with:

```
{{4, 14}, 1} and {{4, 14}, 3}
{{4, 16}, 1} and {{4, 16}, 2}

```

I want that only `{{4, 14}, 1}` and `{{4, 16}, 1}` remain (minimum of the third number).

Finally remains:

```
{{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, {{4, 18}, 1}

```

How can I easily do this??

Answer: 
Yet another way using `Select` and `GatherBy`:

```
list = {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 
    1}, {{4, 18}, 1}, {{4, 14}, 3}, {4, 15}, {{4, 16}, 2}, {4, 18}};
x1 = Select[list, Length[#[[1]]] == 2 &];
x2 = GatherBy[x1, First];
(Sort[#] & /@ x2)[[All, 1]]

```

> 
> {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, {{4, 18}, 1}}
> 
> 
>
Here's a fairly simple way of doing it:-

```
x = {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1},
     {{4, 18}, 1}, {{4, 14}, 3}, {4, 15}, {{4, 16}, 2}, {4, 18}};
x2 = Replace[x, {a_Integer, b_Integer} -> Null, {1}];
x3 = DeleteCases[x2, Null];
types = Union[x3[[All, 1]]];
First[Sort[Cases[x3, {#, _}]]] & /@ types

```

> 
> {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, {{4, 18}, 1}}
> 
> 
>