Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
List Compare and print - Except
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { List<int> first = new List<int>(); first.Add(1); first.Add(2); first.Add(3); first.Add(7); List<int> second = new List<int>(); second.Add(2); second.Add(3); second.Add(5); second.Add(7); List<int> firstNotSecond = first.Except(second).ToList(); List<int> secondNotFirst = second.Except(first).ToList(); Console.WriteLine(firstNotSecond.Count); foreach (int i in firstNotSecond) { Console.WriteLine("List Items in firstNotSecond {0}", i); } Console.WriteLine(secondNotFirst.Count); foreach (int i in secondNotFirst) { Console.WriteLine("List Items in secondNotFirst {0}", i); } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
dima
BFS DFS stack vs recursive
sdefrgthyjuiujyhtgrf
Sort String
C# - string parsing
Pascal's triangle
Binary Search Tree
Dotnet Q-3
C# - String Parsing
IntNull
Please log in to post a comment.