Not able to understand the main function

plsl explain each and every line of the the function in breif

@suryansh771, share the code you are talking about i will try to explain it

pls explain the main function from top to bottom

from line 20 to 23 we are dynamically allocating memory for a matrix of dimensions n*m

lint 20: int ** arr= new int*[n]; (it should be int** instead of int*)
you need to have knowledge of dynammic memory allocation for you to understand this , so if you don;t know about that , i will suggest you to brush up your basics on that topic first now , what we are doing here is we are dynamically allocating an array of integer pointers it returns the address of first pointer from the array of integer pointer so we need a pointer of integer pointer to store that that’s why we did int *arr instead of int ,

in line 21 to 23 ,
we are dynamically allocating an array of integers and storing the pointer returned to arr[i] ,
so we got a dynammically allocated integer matrix of size n*m

If you have doubt in sumOfSubmatrix then do tell me i will explain that

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.