Python Solution with Proof and Explanation (For Beginners)
Conditions \n- If first_digit is missing and second_digit is present :\n    - If second_digit>3:\n        then first_digit can have 2 possiblities only "0" and 
Conditions \n- If first_digit is missing and second_digit is present :\n    - If second_digit>3:\n        then first_digit can have 2 possiblities only "0" and "1"\n    - If second_digit<=3:\n        then first_digit can have 3 possiblities "0" and "1" and "2"\n\n- If second_digit is missing:\n    - If first_digit is also missing:\n        then possiblities of first_digit and second_digit combined are 24\n    - If first_digit is present and first_digit <=1 :\n        then second_digit can have 10 possiblities 0-9 \n    - If first_digit is present and first_digit ==2:\n        then second_digit can have 4 possiblities 0-3\n\n- If third digit is missing: \n    - 6 Possiblitites for third digit\n\n- If fourth digit is missing:\n    - 10 Possiblities for fourth digit\n\n\nFor better calculation assign 1 for digits if they are present and multiplication of all possiblities will give you answer\n\n```python\nclass Solution:\n    def countTime(self, time: str) -> int:\n        a = time[0]\n        b = time[1]\n        c = time[3]\n        d = time[4]\n        \n        result = 1\n        \n        if a == "?" and  b != "?":\n            a1 = 3 if b <= \'3\' else 2\n        else:\n            a1 = 1\n        \n                \n        if b =="?":\n            if a <= "1":\n                b1 = 10\n            elif a == "2":\n                b1 = 4\n            elif a == "?":\n                b1 = 24\n        else:\n            b1 = 1\n                \n                \n        c1 = 6 if c == "?" else 1\n        d1 = 10 if d == "?" else 1\n        \n        return a1 * b1 * c1 * d1\n```
['Python', 'Python3']