Monday, August 4, 2008

fresh and original

I wonder why. I wonder why.
I wonder why I wonder.
I wonder why I wonder why.
I wonder while I wander.

R.P. Feynman

1 comment:

disturbed said...

Here is an interesting coding challenge: write a counter function that counts from 1 to max but only returns numbers whose digits don't repeat.

For example, part of the output would be:

* 8, 9, 10, 12 (11 is not valid)
* 98, 102, 103 (99, 100 and 101 are not valid)
* 5432, 5436, 5437 (5433, 5434 and 5435 are not valid)

Also:

* Display the biggest jump (in the sequences above, it's 4: 98 -> 102)
* Display the total count of numbers
* Give these two values for max=10000



try to do it in minimum lines.....