Added method to calculate the number of possibilities in phone dialpad problem