A nine digit number has the property where the first digit equals the number of zeros and ones used in the number, the second digit equals the number of ones and twos used in the number, the third digit equals the number of twos and threes used in the number, etc. through the ninth digit equals the number of eights and nines used in the number. What could the number be?
A ten digit number has a similar property to the nine digit number. The first digit equals the number of zeros and ones used in the number, the second digit equals the number of ones and twos used in the number, etc. through the ninth digit. And also, the tenth digit equals the number of zeros and nines used in the number. What could this number be?
(In reply to
re(4): Attn: Ken Haley by Penny)
Penny,
That's amazing. I like to use Option Strict, but I've never seen that kind of performance impact. I'm glad it helped.
I tried the global idea in my program--(namely the digits array), but it didn't help it a bit. In fact it slowed things down, because I had to clear it at the top of the check9 and check10 subs, which turns out to take longer than instantiating it. So I made it local again. I tend to favor locals anyway--it prevents certain kinds of bugs, especially in larger programs.
Ken