48. The most frequent element in a range

Write a function that, given a range, returns the most frequent element and the number of times it appears in the range. If more than one element appears the same maximum number of times then the function should return all the elements. For instance, for the range {1,1,3,5,8,13,3,5,8,8,5}, it should return {5, 3} and {8, 3}.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset