Duplicate Diamonds

Optional Node
Premium Content - Free Preview

Scenario
After getting rid of the duplicate addresses on each street in Zumbania, you notice there are tons of duplicate addresses on the avenues! Sometimes the duplicates are near each other but often they're far apart. There's rumor that the king hid diamonds by the duplicate numbers that are furthest from each other. Can you find that number on each avenue?


End of Free Content Preview. Please Sign in or Sign up to buy premium content.

Comments

  • Again, I wish there was an answer somewhere....else, how do I learn from these exercises?

  • But....with only one loop? I'd really like to know how to do that.

  • Actually it should have been clarified - the one loop solution uses another data structure such as a hash map.

Contact Us
Sign in or email us at [email protected]