Share Link
Copied to clipboard
Embed on Your Page
Copied to clipboard
We Stand with Ukraine
Differencebetweentwounorderedlistswithdups by foxandfiddle
Get difference between two unordered, not unique (duplicates) lists!
Solution by https://metadataconsulting.blogspot.com/2021/02/CSharp-dotNet-Get-difference-between-two-unordered-not-unique-lists-aka-duplicates-allowed-within-a-list-and-across-both-lists.html

A  = 1,1,2,3,4,5,9,7,7,7
B  = 1,1,2,2,3,4,5,5,5,5
A Count  = 10
B Count  = 10

No. of loops = 49
(A-B) Result = 9,7,7,7
(B-A) Result = 2,5,5,5
Result Unorderd Final = 2,5,5,5,9,7,7,7 in 2746 ticks.
Result  Ordered Final = 2,5,5,5,7,7,7,9

000 StackOverflow answers all wrong 000
https://stackoverflow.com/questions/15801655/difference-between-two-lists-preserving-duplicates
000 I don't post on StackOverflow because of the idiotic moderators and comments 000

RemoveRage Result = 9,7,7,7 in 7986 ticks.
Lookup Result = 2,5,5,5 in 63723 ticks.
diffLinq Result = 9,7,7,7 in 61540 ticks.
Cached Result
Last Run: 11:49:39 pm
Compile: 0.131s
Execute: 0.015s
Memory: 24kb
CPU: 0.031s