Skip to content

Instantly share code, notes, and snippets.

@icodeintx
Last active December 9, 2022 12:03
Show Gist options
  • Save icodeintx/8ae3cb3d55038bf389f818e149170b14 to your computer and use it in GitHub Desktop.
Save icodeintx/8ae3cb3d55038bf389f818e149170b14 to your computer and use it in GitHub Desktop.
List<long> firstList = new List<long>() {100,102,106,109,110,118,124,125,127,129,130,131,133,137,139,147,149,150,151,152,155,158,159,160,161,163,164,165,166,167,168,170,171,172,173,175,179,181,182,191,198,199,206,214,215,225,237,240,241,242,245,601,602,603,605,606,607,608,609,610,613,614,615,616,617,618,619,620,621,921,925,939,940,947,948,949,950,951,952,953,954,955,959,961,962,963,973,974,1001,1004,1005,6250,6255,6256,6259,6261,6262,6264,6274,6302,6307,6348,6353,6355,6358,6366,6368,6371,6382,6389,6390,6392,6395,6397,6399,6407,6411,6412,6413,6415,6417,6420,6422,6431,6435,6438,6443,6447,6457,6458,6464,6480,6493,6501,6502,6503,6505,6511,6513,6514,6528,6529,6534,6535,6547,6548,6550,6558,6560,6561,6562,6563,6565,6566,6572,6573,6575,6576,6596,6621,6622,6623,6624,6639,6640,6642,6649,6650,6651,6652,6656,6674,6675,6676,6724,6725,6726,6727,6730,6731,6732,7622,8707,9518};
List<long> secondList = new List<long>() {101,102,104,105,106,107,108,109,110,112,113,114,115,116,117,118,119,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,196,197,198,199,200,201,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,222,224,225,226,227,228,229,230,235,236,237,238,239,240,241,242,244,245,246,247,601,602,603,605,606,607,608,609,610,613,614,615,616,617,618,619,620,621,901,902,903,904,905,906,907,908,909,910,911,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,942,943,944,945,946,947,948,949,950,951,952,953,954,955,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,1000,1002,1003,1004,1005,1006,1007,1008,1009,1010,5000,5002,5003,5004,5005,5100,5101,6221,6223,6231,6232,6233,6234,6248,6249,6250,6251,6252,6254,6255,6256,6257,6258,6259,6260,6261,6262,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6279,6280,6281,6283,6284,6286,6287,6288,6290,6291,6299,6300,6302,6303,6305,6307,6312,6317,6319,6320,6321,6322,6323,6324,6325,6330,6332,6334,6335,6336,6337,6338,6340,6341,6342,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6358,6359,6360,6361,6363,6364,6365,6366,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6593,6594,6595,6596,6597,6598,6599,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,7622,8520,8618,8707,8819,8821,8822,8823,8824,8825,8826,8827,8829,8830,8831,8832,8833,9532,9533,9534,9535,9557,9558,9559,9560};
var notInfirstList = firstList.Except(secondList).ToList();
notInfirstList.Sort();
var notInfirstListString = string.Join(',', notInfirstList);
Console.WriteLine($"In {nameof(firstList)} Not In {nameof(secondList)} - Count ({notInfirstList.Count().ToString()})");
Console.WriteLine($"{notInfirstListString}\n");
var notInsecondList = secondList.Except(firstList).ToList();
notInsecondList.Sort();
var notInsecondListString = string.Join(',', notInsecondList);
Console.WriteLine($"In {nameof(secondList)} Not In {nameof(firstList)} - Count ({notInsecondList.Count.ToString()})");
Console.WriteLine($"{notInsecondListString}");
//now union the two original lists
var combined = firstList.Union(secondList).ToList();
string combinedResult = string.Join(',', combined);
Console.WriteLine($"");
Console.WriteLine($"Combined lists - Count ({combined.Count().ToString()})");
Console.WriteLine(combinedResult);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment