You are viewing a single comment's thread. Return to all comments →
My java submission:
static int[] getRecord(int[] s) { int highest, lowest; highest = lowest = s[0]; int[] result = new int[2]; for (int s_i = 1; s_i < s.length; s_i++) { if (s[s_i] > highest) { highest = s[s_i]; ++result[0]; } else if (s[s_i] < lowest) { lowest = s[s_i]; ++result[1]; } } return result; }
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 →
My java submission: