Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What Am I Doing Wrong?

Name: Anonymous 2008-05-22 22:02

http://javabat.com/prob?id=AP1.scoresIncreasing

public boolean scoresIncreasing(int[] scores) {
  boolean increase = true;
 
  for (int i = 1; ((i) < (scores.length + 1)); i++){
  if (scores[i] > scores[i+1]){
  increase = false;
  }
  }
 
  return increase;
}

Name: FUCK 2008-05-24 15:50

Given a non-empty array, return true if there is a place to split the array so that the sum of the numbers on one side is equal to the sum of the numbers on the other side.

canBalance({1, 1, 1, 2, 1}) → true
canBalance({2, 1, 1, 2, 1}) → false
canBalance({10, 10}) → true

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List