in reply to print identical keys once along with their values

You might want to take kennethk's last bit of advice first. Work out the mechanism first by hand. That will inform your choice of control structure and data structure.

Dum Spiro Spero
  • Comment on Re: print identical keys once along with their values