You are viewing a single comment's thread. Return to all comments →
Show, my solution is very like with yours, nice to see the similarities, see it:
static int[] getRecord(int[] s){ int[] result = new int[2]; int countMax=0, countMin=0 ,max = s[0], min = s[0]; for(int i=1; i< s.length; i++){ if(s[i] > max){ max = s[i]; countMax++; } if(s[i] < min){ min = s[i]; countMin++; } } result[0] = countMax; result[1] = countMin; 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 →
Show, my solution is very like with yours, nice to see the similarities, see it: