please find the error and explain the solution
link to the code i wrote
Not getting how to take query q and take sum q no of times
@rsumitaj problem is at line 18, where in j’s for-loop you have mis-typed ‘i’ at some places.
Also, one more modification for finding the answers of query you can do is, when you have find answer like (i,j) to (ei, ej) then if i==0 or j==0 or (i==0 && j==0).
In these cases you have to take care for -ve index while calculating the answer of query.
can you please modify my codeon ide for the negative index
@rsumitaj i have done the required changes https://ide.codingblocks.com/s/227761
Let me know if you have some doubt in this code.
Otherwise please mark this doubt as resolved.
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.