How do I count the occurrence of a number in an array?

Asked

Viewed 13 times

-1

I am wanting to create a function that indicates to me the occurrence of a number on a list in a simple way, without advanced knowledge.

For example, a list of 10 numbers: [1, 3, 2, 4, 5, 2, 3, 6, 2, 1].

In this case the number with the highest occurrence would be the 2 that was repeated 3 times.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.