Mobile Numeric Keypad Problem Leetcode Javascript Question