Biggest Pair


Premium Content - Free Preview

The people of Zumbania share a lot with their next-door neighbors, so wealth can be measured by looking at pairs of people. You would like to find the richest pair on each street in Zumbania.


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

Comments

  • at first I misunderstood the challange and was searching for consecutive numbers like 4+5 and 2+3 but didnt realize only the indexes in array need to be consecutive 30+70 wouldnt work...

  • https://www.learneroo.com/user_answers/6874565726
    Would someone take a look at my code? What I am specifically having trouble is this: I seem to not be storing the correct value for the biggest

    cont...
  • a solution:

    my code

  • This code keeps timing out. Can someone tell me if it would work if it didn't?
    https://www.learneroo.com/user_answers/4065805762

  • Your piece i=i++ should be i++.

  • I don't understand this error message.
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
    at Main.doStuff(Main.java:7)
    at Main.main(Main.java:27)

    my code

  • It means you're trying to call an index in an array that is outside the bounds (or size) of the array. What would happen when you reach this line when you're already up to the last item? sum = ar[i] + ar[i+1];

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