• + 0 comments

    I am trying to solve it using c

    int* breakingRecords(int scores_count, int* scores, int* result_count) {
     int min=scores[0], max=scores[0],min_count=0,max_count=0;
     for (int i=0; i<scores_count; i++) {
        if (scores[i]<min) {
            min=scores[i];
            min_count++;
        }
        else if (scores[i]>max) {
            max=scores[i];
            max_count++;
        }
     }
     result_count[1]=min_count;
     result_count[0]=max_count;
     return result_count;
    }
    

    ` my output contains min_count max_count 0 another garbege value it should contain only the first two value instead it have 4 values HELP