Python | Brute Force | Straightforward
Intuition:\nIn this solution, we will consider two parts minutes and hours to find the number of permutations.\n\n#### Complexity Analysis:\nTime Complexity: O(
#### Intuition:\nIn this solution, we will consider two parts `minutes` and `hours` to find the number of permutations.\n\n#### Complexity Analysis:\n`Time Complexity: O(1)`\n`Space Complexity: O(1)`\n\n#### Code:\n```\nclass Solution:\n    def countTime(self, time: str) -> int:\n        first, second, _, third, fourth = time\n\t\t\n        if third == \'?\' and fourth == \'?\': # third can be 0-5, fourth can be 0-9\n            minutes = 60\n        elif third == \'?\' and fourth != \'?\': # third can be 0-5, fourth is fixed\n            minutes = 6\n        elif third != \'?\' and fourth == \'?\': # third is fixed, fourth can be 0-9\n            minutes = 10\n        else:\n            minutes = 1\n            \n        if first == \'?\' and second == \'?\': # first and second together can be 0-23\n            hours = 24\n        elif first == \'?\' and second != \'?\':\n            if int(second) < 4: # if second < 4, means we can include 2 as hour starting with 2 can only be 20-23\n                hours = 3\n            else: # if second >= 4, we can only include 0, 1, same reasoning as above\n                hours = 2\n        elif first != \'?\' and second == \'?\':\n            if int(first) == 2: # if first is 2, we can only choose 0-3 as valid hour is 20-23\n                hours = 4\n            else: #  we can choose 0-9\n                hours = 10\n        else: \n            hours = 1\n        \n        return minutes * hours\n```
[]