I have a list which contains ids and values and I need to remove ids duplication. I am looking for an efficiently way preferable in LINQ, instead of my loop and if condition. Thank you for any help and advise.
var list = new List<Tuple<int, double>>();
Current values:
1, 3.6
1, 3.8
2, 5.6
3, 8.1
Wished values:
1, 3.6
2, 5.6
3, 8.1
for (int i = 0; i < list.Count - 1; i++)
{
if (list[i].Item1 == list[i + 1].Item1)
list.RemoveAt(i+ 1);
}