You are viewing a single comment's thread. Return to all comments →
Heh heh heh, my solution is very similar to yours and Julio's
static int[] getRecord(int[] s){ if (s.length == 0) { return new int[2]; } int lowest = s[0]; int highest = s[0]; int lowestCount = 0; int highestCount = 0; for (int score : s) { if (score < lowest) { lowest = score; lowestCount++; } else if (score > highest) { highest = score; highestCount++; } } return new int[]{highestCount, lowestCount}; }
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
Heh heh heh, my solution is very similar to yours and Julio's