You are given a 2D array of sales data where the first column is Product ID and the second column is the quantity. Write a function to take this list of data and return a new 2D array with the total sales for each product ID. code example
Example 1: c fill 2d array
int disp[2][4] = {
{10, 11, 12, 13},
{14, 15, 16, 17}
};
int disp[2][4] = { 10, 11, 12, 13, 14, 15, 16, 17};
int i, j;
for (i = 0; i < HEIGHT; i++) {
for (j = 0; j < WIDTH; j++) {
disp[i][j] = disp[i][j];
}
}
Example 2: 2d arrays | java
int[][] arr = new int[row][column];