Practice Minimum Operations to Make a Special Number
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
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.
Source: Minimum Operations to Make a Special Number on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
num = "2245047"
2
# Example 2
num = "2908305"
3
# Example 3
num = "10"
1
Constraints
Related LeetCode Problems
Practice more problems similar to Minimum Operations to Make a Special Number.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.