[2437] JavaScript ugly solution with array | 85~119 ms
\nvar countTime = function(time) {\n    let arr = time.split(":").join("");\n    let base = [2, 10, 6, 10];\n    let valid = 1;\n    let i = 0;\n    \n    //  r
```\nvar countTime = function(time) {\n    let arr = time.split(":").join("");\n    let base = [2, 10, 6, 10];\n    let valid = 1;\n    let i = 0;\n    \n    //  reset base, when "??:xx" | "?0~3:xx" | "2?:xx"\n    if(arr[0] === \'?\'){\n        if(arr[1] === \'?\'){\n            valid = 24;\n            i = 2;\n        }\n        else if(+arr[1] <= 3)\n            base[0] = 3;\n    }\n    else if( (arr[1] === \'?\') && (+arr[0] === 2) )\n        base[1] = 4;\n    \n    while(i < base.length){\n        if(arr[i] === \'?\')\n            valid *= base[i];\n        i++;\n    }\n    \n    return valid;\n};\n```
['JavaScript']