You are viewing a single comment's thread. Return to all comments →
Any opinion?
static int migratoryBirds(int n, int[] ar) { int count = 0; int maxCount = 0; int maxType = 0; for (int i = 1; i < 6; i++) { count = 0; for (int j = 0; j < n; j++) { if (ar[j] == i) { count++; } } if (count > maxCount) { maxCount = count; maxType = i; } } return maxType; }
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
Any opinion?