Maximum Repeating Number Leetcode Javascript