TheRealSamuel/LeetCodeProblem
0572
1{2 "id": 3046,3 "name": "minimum_operations_to_make_a_special_number",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/minimum-operations-to-make-a-special-number/",6 "date": "2023-08-27 00:00:00",7 "task_description": "You are given a **0-indexed** string `num` representing a non-negative integer. In one operation, you can pick any digit of `num` and delete it. Note that if you delete all the digits of `num`, `num` becomes `0`. Return _the **minimum number of operations** required to make_ `num` special. An integer `x` is considered **special** if it is divisible by `25`. **Example 1:** ``` **Input:** num = \"2245047\" **Output:** 2 **Explanation:** Delete digits num[5] and num[6]. The resulting number is \"22450\" which is special since it is divisible by 25. It can be shown that 2 is the minimum number of operations required to get a special number. ``` **Example 2:** ``` **Input:** num = \"2908305\" **Output:** 3 **Explanation:** Delete digits num[3], num[4], and num[6]. The resulting number is \"2900\" which is special since it is divisible by 25. It can be shown that 3 is the minimum number of operations required to get a special number. ``` **Example 3:** ``` **Input:** num = \"10\" **Output:** 1 **Explanation:** Delete digit num[0]. The resulting number is \"0\" which is special since it is divisible by 25. It can be shown that 1 is the minimum number of operations required to get a special number. ``` **Constraints:** `1 <= num.length <= 100` `num` only consists of digits `'0'` through `'9'`. `num` does not contain any leading zeros.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "num = \"2245047\"",12 "output": "2 "13 },14 {15 "label": "Example 2",16 "input": "num = \"2908305\"",17 "output": "3 "18 },19 {20 "label": "Example 3",21 "input": "num = \"10\"",22 "output": "1 "23 }24 ],25 "private_test_cases": [26 {27 "input": "85747673",28 "output": 829 },30 {31 "input": "213438082089793853621021796067458197596396535421424899171828999764856",32 "output": 433 },34 {35 "input": "622404",36 "output": 537 },38 {39 "input": "74920418046712891530392521430",40 "output": 441 },42 {43 "input": "107664989061994720328852210923392478740254117777263443323050097",44 "output": 245 },46 {47 "input": "446820425182578457880530",48 "output": 149 },50 {51 "input": "16337839964393636813143382357049798824604286130088792",52 "output": 553 },54 {55 "input": "68921026690886473560317663709997874539041866676838",56 "output": 1357 },58 {59 "input": "4217332364108326476826541",60 "output": 361 },62 {63 "input": "58069516435312",64 "output": 1265 }66 ],67 "haskell_template": "minimumOperations :: String -> Int\nminimumOperations num ",68 "ocaml_template": "let minimumOperations (num: string) : int = ",69 "scala_template": "def minimumOperations(num: String): Int = { \n \n}",70 "java_template": "class Solution {\n public int minimumOperations(String num) {\n \n }\n}",71 "python_template": "class Solution(object):\n def minimumOperations(self, num):\n \"\"\"\n :type num: str\n :rtype: int\n \"\"\"\n "72}