Question: Complete the function compress _ matrix that takes a 2 D array as a parameter and return a new compressed 2 D array. In the
Complete the function compressmatrix that takes a D array as a parameter and
return a new compressed D array. In the given array the number of row and column will
always be even. Compressing a matrix means grouping elements in blocks and
sums the elements within each block. Check the sample input output for further
clarification.
Hint: Generally the block consists of the and elements
for blocks.
You cannot use any builtin function except len and range You can use the
variable to create an array.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
