Maximum Repeating Number Leetcode Problems Javascript