You are viewing a single comment's thread. Return to all comments →
C++
int migratoryBirds(vector<int> arr) { vector<int>countBirds(5, 0); for (int bird : arr) { countBirds[bird-1]++; } return distance( countBirds.begin(), max_element(countBirds.begin(), countBirds.end()))+1; }
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 →
C++