Don’t give me five!

From codewars.com by Edxael  (that’s me)

In this kata you get the start number and the end number of a region and should return the count of all numbers except numbers with a 5 in it. The start and the end number are both inclusive!

Examples:

The result may contain fives. 😉
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.

Have fun coding it and please don’t forget to vote and rank this kata! 🙂

I have also created other katas. Take a look if you enjoyed this kata!

— My Solution —

Note:  The following code is not written by me, it was created by another user of codewars.com it belongs to the user: narayanswa30663

 

x



Copyright 2017. All rights reserved.

Posted January 17, 2017 by Edmundo in category "Ruby Examples