int **list, **short_list;
//num defines the number of rows and 2 defines no. of column needed
list = malloc(num * 2 * sizeof(int *));
short_list = malloc(num * 2 * sizeof(int *));
for(i = 0; i < num; i++){
list[i] = malloc(num * 2 * sizeof(int));
short_list[i] = malloc(num * 2 * sizeof(int));
}
Though I have created dynamic memory allocation using pointers to array, undergone "Memory Limit exceeded" error to few of my outputs in hackerearth. Is this way of memory allocation is wrong.