maneuver, one can choose any single digit and eliminate it (for example one chooses some situation in the number and eliminates the digit situated at this position). The activity can't be performed if by some stroke of good luck one digit remains. In the event that the subsequent number contains driving zeroes, they are naturally taken out. For example on the off chance that one eliminates from the number 32925 the 3-rd digit, the subsequent number will be 3225. On the off chance that one eliminates from the number 20099050
Please do in python. Correct answer will upvoted else downvoted
It is given a positive integer n. In 1 maneuver, one can choose any single digit and eliminate it (for example one chooses some situation in the number and eliminates the digit situated at this position). The activity can't be performed if by some stroke of good luck one digit remains. In the event that the subsequent number contains driving zeroes, they are naturally taken out. For example on the off chance that one eliminates from the number 32925 the 3-rd digit, the subsequent number will be 3225. On the off chance that one eliminates from the number 20099050 the primary digit, the subsequent number will be 99050 (the 2 zeroes going close to the main digit are naturally taken out).
What is the base number of steps to get a number with the end goal that it is distinct by 25 and positive? It is ensured that, for every n happening in the input, the appropriate response exists. It is ensured that the number n has no driving zeros.
Input :The main line contains one integer t (1≤t≤104) — the number of experiments. Then, at that point, t experiments follow.
Each experiment comprises of one line containing one integer n (25≤n≤1018). It is ensured that, for every n happening in the input, the appropriate response exists. It is ensured that the number n has no driving zeros.
Output :For each experiment output on a different line an integer k (k≥0) — the base number of steps to get a number with the end goal that it is separable by 25 and positive.
Step by step
Solved in 4 steps with 1 images