score:17

Accepted answer
var result =
    from x in xs
    group xs by x into grp
    where grp.count() == 1
    select grp.key;

like that?

50seconds too late ... :/

score:0

various extension methods you could use:

public static ienumerable<t> whereunique<t>(this ienumerable<t> items)
{
    return items.groupby(x => x).where(x => x.count() ==1).select(x => x.first());
}

possibly slightly more performant, depending on the distribution of your data:

public static ienumerable<t> whereunique<t>(this ienumerable<t> items)
{
    return items.groupby(x => x).where(x => !x.skip(1).any()).select(x => x.first());
}

and whereuniqueby, which works similiar to morelinqs distinctby():

public static ienumerable<t> whereuniqueby<t, tselector>(this ienumerable<t> items, func<t, tselector> func)
{
    return items.groupby(func).where(x => x.count() ==1).select(x => x.first());
}

score:11

list.groupby(i => i)
    .where(g => g.count() == 1)
    .select(g => g.first());

Related Query

More Query from same tag