[Python] No math, simple pattern check - O(1) - Clean & Concise
Code\npython\nclass Solution:\n    def countTime(self, time: str) -> int:\n        def getString2Chars(value):\n            if value < 10:\n                retu
# Code\n```python\nclass Solution:\n    def countTime(self, time: str) -> int:\n        def getString2Chars(value):\n            if value < 10:\n                return "0" + str(value)\n            return str(value)\n        \n        def isMatching(clock, pattern):\n            s = getString2Chars(clock)\n            if pattern[0] != "?" and s[0] != pattern[0] or pattern[1] != "?" and s[1] != pattern[1]:\n                return False\n            return True\n            \n        \n        hPattern, mPattern = time.split(":")\n        ans = 0\n        hhCnt, mmCnt = 0, 0\n        for hh in range(24):\n            if isMatching(hh, hPattern):\n                hhCnt += 1\n        for mm in range(60):\n             if isMatching(mm, mPattern):\n                mmCnt += 1\n        return hhCnt * mmCnt\n```\nComplexity:\n- Time & Space: `O(1)`
['Python3']