Driver Code
let keypad = [ [ ' ' , ' ' , ' ' ] , [ ' ' , ' ' , ' ' ] , [ ' ' , ' ' , ' ' ] , [ ' ' , ' ' , ' ' ] ] ; document . write ( " " + 1 + " " + getCount ( keypad , 1 ) + " " ) document . write ( " " + 2 + " " + getCount ( keypad , 2 ) + " " ) document . write ( " " + 3 + " " + getCount ( keypad , 3 ) + " " ) document . write ( " " + 4 + " " + getCount ( keypad , 4 ) + " " ) document . write ( " " + 5 + " " + getCount ( keypad , 5 ) + " " )