algorithms/implementation/acm-icpc-team.c
int* acmTeam(int topic_count, char** topic, int* result_count) {
    static int result[2];

    int max = 0;
    int count = 0;

    for (int i = 0; i < topic_count; i++) {
        for (int j = i + 1; j < topic_count; j++) {
            int skills = 0;
            for (int k = 0; topic[i][k]; k++) {
                if (topic[i][k] == '1' || topic[j][k] == '1') {
                    skills++;
                }
            }
            if (skills == max) {
                count++;
            }
            else if (skills > max) {
                max = skills;
                count = 1;
            }
        }
    }
    
    *result_count = 2;
    result[0] = max;
    result[1] = count;
    return result;
}
// Please store the size of the integer array to be returned in result_count pointer. For example,
// int a[3] = {1, 2, 3};
//
// *result_count = 3;
//
// return a;
//
Please store the size of the integer array to be returned in result_count pointer.



return a.
Please store the size of the integer array to be returned in result_count pointer . return a .
int* acmTeam(int topic_count, char** topic, int* result_count) {
    static int result[2];
    int max = 0;
    int count = 0;
    for (int i = 0; i < topic_count; i++) {
        for (int j = i + 1; j < topic_count; j++) {
            int skills = 0;
            for (int k = 0; topic[i][k]; k++) {
                if (topic[i][k] == '1' || topic[j][k] == '1') {
                    skills++;
                }
            }
            if (skills == max) {
                count++;
            }
            else if (skills > max) {
                max = skills;
                count = 1;
            }
        }
    }
    *result_count = 2;
    result[0] = max;
    result[1] = count;
    return result;
}
int * acmTeam ( int topic_count , char * * topic , int * result_count ) { static int result [ 2 ] ; int max = 0 ; int count = 0 ; for ( int i = 0 ; i < topic_count ; i ++ ) { for ( int j = i + 1 ; j < topic_count ; j ++ ) { int skills = 0 ; for ( int k = 0 ; topic [ i ] [ k ] ; k ++ ) { if ( topic [ i ] [ k ] == ' ' || topic [ j ] [ k ] == ' ' ) { skills ++ ; } } if ( skills == max ) { count ++ ; } else if ( skills > max ) { max = skills ; count = 1 ; } } } * result_count = 2 ; result [ 0 ] = max ; result [ 1 ] = count ; return result ; }
Please store the size of the integer array to be returned in result_count pointer.
Please store the size of the integer array to be returned in result_count pointer .