Problem of the Day
A new programming or logic puzzle every Mon-Fri

5/5

The fifth of May, what a glorious day. Today's problem is all about finding duplicates such as with today's date. For the numbers [10-10,000] print out all the numbers who only use one type of digit (ie: 55 but not 45). Can you come up with a sub linear algorithm to solve this?

Permalink: http://problemotd.com/problem/55/

Comments:

  • Anonymous - 8 years, 11 months ago

    samelist = []
    i = 1
    while i < 9:
        number = i
        while number < 10000:
            samelist.append(number)
            number = i + number*10
        i = i + 1
    
    print samelist
    

    reply permalink

  • Anonymous - 8 years, 11 months ago

    Oops, that should be i < 10.

    reply permalink

Content curated by @MaxBurstein