Convert List> into List in C#

后端 未结 3 629
醉梦人生
醉梦人生 2020-12-10 11:08

I have a List>. I would like to convert it into a List where each int is unique. I was wondering if anyone had a

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 11:29

    List result = listOfLists
      .SelectMany(list => list)
      .Distinct()
      .ToList();
    

提交回复
热议问题