Most Frequent Number Following Key Leetcode Javascript Solution