in reply to Re: Find duplicate digits
in thread Find duplicate digits

You can try the following algorithm:

  1. pass through your input one digit per time
  2. use a hash to count how often each digit occurs
  3. once you are finished, pass through the hash (again) to see how many digits are ocuring two times
  4. print yes/no

Once you have done this, think how to adapt the algorithm to handle the special case 1111....

Have Fun! Rata

PS.: it is good that you looked for an old thread! However you'll get more answers if you'd opened a new thread and just had provided a link to the old one! well, next time ;-)

Replies are listed 'Best First'.
Re^3: Find duplicate digits
by mroman (Initiate) on Apr 07, 2010 at 13:18 UTC
    Ratazong,

    Thank you for your reply.

    (vigorously flapping noob wings)

    Argh! Can't fly that high as of yet . . .

    I will link to a thread instead next time however :)

    Cheers,

    M.Roman