Kindly explain the final solution of sum of all submatrices

hi, I could not understand the concept of contribution of elements, etc could you please explain the whole concept of the final solution

hi @gurkirat2600
go through the lecture again and try to dry run on paper, u will get better insight…
u can refer this code --> https://ide.codingblocks.com/s/235562

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.