Simple solution in Kotlin. With notes and simplifications
Description\n - Code works great\n# Code\n\nclass Solution {\n    fun countTime(time: String): Int {\n        var result = 1\n\n        //===== All symbols unkn
# Description\n - **Code works great**\n# Code\n```\nclass Solution {\n    fun countTime(time: String): Int {\n        var result = 1\n\n        //===== All symbols unknown =====//\n        if (time == "??:??")\n            return 24*60\n\n\n        //===== Hour(s) unknown =====//\n        \n        // h1h2 unknown\n        if (time[0] == \'?\' && time[1] == \'?\')\n            result *= 24\n        // h1 unknown\n        else if (time[0] == \'?\')\n            result *= if (time[1] == \'0\'\n                    || time[1] == \'1\'\n                    || time[1] == \'2\'\n                    || time[1] == \'3\') 3 else 2\n        // h2 unknown\n        else if (time[1] == \'?\')\n            result *= if (time[0] == \'0\' || time[0] == \'1\') 10 else 4 \n\n\n        //===== Minute(s) unknown =====//\n        \n        // m1m2 unknown\n        if (time[3] == \'?\' && time[4] == \'?\')\n            result *= 60\n        // m1 unknown\n        else if (time[3] == \'?\')\n            result *= 6\n        // m2 unknown\n        else if (time[4] == \'?\')\n            result *= 10\n        \n\n        // Result\n        return result\n    }\n}\n```\n\n---\n\n# Offtop:\n(The code above works! The text below is about an unsuccessful option)\nThere is one solution that doesn\'t work. Can you explain why?\n\nLook at part of my true beautiful code version:\n```\n// h1 unknown\n        else if (time[0] == \'?\')\n            result *= if (time[1].toInt() < 4) 3 else 2\n// h2 unknown\nelse if (time[1] == \'?\')\n            result *= if (time[0].toInt() < 2) 10 else 4 \n```\n**Idk why e.g. in case "?2:54"  this code don\'t work in h1 part**\nBut if compare over each char (time[1] == \'1\' etc.) - it\'s work   xD\nIn h2 part the same stupidity  ^_^\n\nActually, for this, I wrote a comparison with each symbol and now the solution is 100% correct, "surprise"\n```\n// h2 unknown\n        else if (time[1] == \'?\')\n            result *= if (time[0] == \'0\' || time[0] == \'1\') 10 else 4 \n```\n---\n![Screenshot 2023-05-01 at 00-32-56 Number of Valid Clock Times - LeetCode.png](https://assets.leetcode.com/users/images/9bd836ff-79e5-44ed-9282-0b1b1ee38eaa_1682890409.2968547.png)\n\nMaybe the tests are stupid?\n**If you can explain to me what is wrong, I will be grateful!**  \u2764\uFE0F
['Kotlin']