Given an array of numbers, find the most recurrent number.
For example, given [1, 2, 3, 4, 3]
, your algorithm should return 3
, as it
has the highest level of recurrence. For ties, return the first found more
recurrent number.
The file you will be editing is most-recurrent.js
.
The most-recurrent-test.js
file includes a test suite to run your code against.
Run node most-recurrent-test.js
to run the test suite in full. As you
write code to pass tests, make sure you unskip succeeding tests by changing
test.skip
to just test
.