How can I get the most used byte array from another bytearray? Is there is simple way to do this?
So for example:
the input byte array: 41, 4, 5, 42,4,5,42,4,5,42,2
And then the return: 4, 5, 42
Thanks in advance.
var grouped = prod.ToLookup(x => x);
var maxRepetitions = grouped.Max(x => x.Count());
var allItemsWithEqualMax = grouped.Where(x => x.Count() == maxRepetitions)
.Select(x => x.Key).ToList();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.