algorithms/implementation/migratory-birds.c
int migratoryBirds(int arr_count, int* arr) {
    int types[6] = {0, 0, 0, 0, 0, 0};
    
    for (int i = 0; i < arr_count; i++)
    {
        types[arr[i]]++;
    }

    int max = types[1];
    int max_id = 1;
    for (int i = 2; i <= 5; i++)
    {
        if (types[i] > max)
        {
            max = types[i];
            max_id = i;
        }
    }
    
    return max_id;
}
// Complete the migratoryBirds function below.
Complete the migratoryBirds function below.
Complete the migratoryBirds function below .
int migratoryBirds(int arr_count, int* arr) {
    int types[6] = {0, 0, 0, 0, 0, 0};
    for (int i = 0; i < arr_count; i++)
    {
        types[arr[i]]++;
    }
    int max = types[1];
    int max_id = 1;
    for (int i = 2; i <= 5; i++)
    {
        if (types[i] > max)
        {
            max = types[i];
            max_id = i;
        }
    }
    return max_id;
}
int migratoryBirds ( int arr_count , int * arr ) { int types [ 6 ] = { 0 , 0 , 0 , 0 , 0 , 0 } ; for ( int i = 0 ; i < arr_count ; i ++ ) { types [ arr [ i ] ] ++ ; } int max = types [ 1 ] ; int max_id = 1 ; for ( int i = 2 ; i <= 5 ; i ++ ) { if ( types [ i ] > max ) { max = types [ i ] ; max_id = i ; } } return max_id ; }
Complete the migratoryBirds function below.
Complete the migratoryBirds function below .