Maximum Repeating Number Leetcode Javascript Practice