how do i check if i have the same object/number 2 times or more in an array ?

How would i go and count the amount of Actors in an array, but being modular so i just get the amount of containing same actor in that array?

for example array is like this

Flashlight
Flashlight
Apple
gun
gun
can

How would i go about and output that there are 2 Flahlights, 1 apple, 2 guns and 1 can without filter array having to be set-up for all of them? So meaning it just gets the amount and i don’t need to create a new filter array for every item?

Is there a way for this? Not sure if i should reply with this on this old post but i figured it’s kind of in the same area?

Greetings,
Celeste