if i initialize variable csum out side the loop it doesnt run in side the loop we have to again give its value why
here is the code:
Just a small doubt in my code
hey since i, j tells the starting and ending point of loop and k iterates it you must declare the variable cumsum inside i, j loop
i think it is csum but we also declare array outside the loop but use it inside it. In the same case, we have declared left and right outside the loop but used it inside the loop.
we need to change csum for each subarray, but we dont need to change the array at any point in time, so we can declare array outside and we need to declate csum inside.
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.