Question :
You will be given the starting and ending integers of a sequence and should return the number of integers within it which do not contain the digit 5
. The start and end numbers should be included!
Examples:
1,9 → 1,2,3,4,6,7,8,9 → Result 8
4,17 → 4,6,7,8,9,10,11,12,13,14,16,17 → Result 12
50,60 → 60 → Result 1
-59,-50 → → Result 0
The result may contain five.
The start number will always be smaller than the end number. Both numbers can be also negative!
I'm very curious for your solutions and the way you solve it. Maybe someone of you will find an easy pure mathematics solution.
Edit This is a code-golf challenge, so the shortest code wins.
50, 59 -> 0
. \$\endgroup\$ – Zgarb Jan 20 '17 at 12:28