How to find the count of each element in an array that is duplicated and print that value in output?

Sandeep, simplest way would be using a LINQ query.

dict = (From item In intArray
Group item By value= item Into GroupResult=Group
Select GroupResult).ToDictionary(Function(x) CInt(x(0)), Function(y) CInt(y.Count))

Where dict => Dictionary(of Int32, Int32); intArray = Integer Array ( {1,2,1,1,2,3,4,5,1,1})

1 Like