Simple pure C solution (with prefix sum)
Code

# Code
```c []

typedef struct {
    int** coord;
    int num;
    int* prefix;
} Solution;


Solution* solutionCreate(int** rects, int rectsSize, int* rectsColSize) {
    srand( (unsigned) time(NULL) );
    Solution* obj = malloc(sizeof(Solution));
    obj->num=0;
    obj->coord = malloc(sizeof(int*)*rectsSize);

    for(int i=0;i<rectsSize;i++)
    {
        int* coord = malloc(sizeof(int)*4);
        // rects[i][0] //down left x
        // rects[i][1] //down left y
        // rects[i][2] //top  right x
        // rects[i][3] //top  right y    
        coord[0]=rects[i][0];
        coord[1]=(rects[i][2]-rects[i][0])+1;
        coord[2]=rects[i][1];
        coord[3]=(rects[i][3]-rects[i][1])+1;
        obj->coord[obj->num++]=coord;
    }

    obj->prefix = calloc(rectsSize+1, sizeof(int));

    for(int i=1;i<=rectsSize;i++)
    {
        obj->prefix[i]=obj->prefix[i-1]+(obj->coord[i-1][1]*obj->coord[i-1][3]);
    }

    return obj;
}

int* solutionPick(Solution* obj, int* retSize) {
    //printf("%d\n", rand());
    int random_idx = rand()%obj->prefix[obj->num];
    //printf("sum = %d\n", obj->prefix[obj->num]);
    // int random_x = obj->coord[random_idx][0]+rand()%obj->coord[random_idx][1];
    // int random_y = obj->coord[random_idx][2]+rand()%obj->coord[random_idx][3];

    int* ans = malloc(sizeof(int)*2);
    for(int i = 1;i<=obj->num;i++)
    {
        
        if(random_idx<obj->prefix[i])
        { 
            ans[0]= obj->coord[i-1][0]+rand()%obj->coord[i-1][1];
            ans[1]= obj->coord[i-1][2]+rand()%obj->coord[i-1][3];
            break;
        }
    }
    *retSize=2;
    return ans;
}

void solutionFree(Solution* obj) {
    free(obj->coord);
    free(obj);
}

/**
 * Your Solution struct will be instantiated and called as such:
 * Solution* obj = solutionCreate(rects, rectsSize, rectsColSize);
 * int* param_1 = solutionPick(obj, retSize);
 
 * solutionFree(obj);
*/
```
['C', 'Prefix Sum']