Mid Term 1 - Solution
Mid Term 1 - Solution
Here the highlighted 10x10 region has the top left corner (-4,2). There are 12 1x1 regions of crop1, 8 regions of crop 2,
32 regions of crop 3 and 48 such regions of crop 4. The resultant two dimensional array must have sizes 13, 9, 33, 49
for row1, row2, row3 and row 4 respectively. The resultant array must be as follows.
Note: You are supposed to provide a generic code that should work accurately for any given top left corner.
return data;
delete[] name1;
delete[] name2;
for (int i = 0;i < 2;i++)
cout << s[i] << endl;
delete[] s;
s = nullptr;
return 0;