Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 774575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:09:11+00:00 2026-05-14T19:09:11+00:00

I am a bit new to LINQ, here is my problem. I have a

  • 0

I am a bit new to LINQ, here is my problem.

  • I have a List of List of Items
  • I like to get the Items which are present in
    only one List (and if I could get the
    List in which they are without
    re-iterating through the “list of
    list” that would be great).

I am trying without success to use the Aggregate / Except / Group keywords in the Linq query but nothing close to a solution so far.

[EDIT]
Could be for instance List<List<int>> and the condition that the value of the int is is not in the others lists.

To be honest if I tried with several foreach I succeed to find the value items but as I am trying to learn LINQ I would like to know what kind of query I should write to get the results

for instance

 1,2,6
 1,6
 3,5
 5,10
 3,10,6

will return 2 and the first list

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:09:11+00:00Added an answer on May 14, 2026 at 7:09 pm
    var query = from list in lists
                from value in list
                where lists.Where(l => l.Contains(value)).Any()
                select new { List = list, Value = value };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of code that looks like this: text = reg.Replace(text, new
A bit new with WPF...It seems like not matter what I change with horizontal
I am a bit new to Perl, but here is what I want to
The problem is simple, but I'm struggling a bit already. Server server = new
I'm a bit new to WCF and I don't think I completely understand what
Thanks for reading. I'm a bit new to jQuery, and am trying to make
I'm setting up a new 64 bit machine to run as a build server.
The following bit of code catches the EOS Exception using (var reader = new
I'm fairly new to the Zend Framework and MVC and I'm a bit confused
When beginning a new web project, i'm always a bit worried about removing pieces

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.