code- https://ide.codingblocks.com/s/144509
//Same code as taught in the lecture
Wrong Solution , what to modify
Hi Rohan, there are two minor mistakes in your implementation.
1st : the updates are not incremental. So you are not supposed to add the new value to a given index rather update it to the new value.
2nd : the way you subtract 1 from the input index ql[i] because of the zero based indexing, you dont need to subtract a one from qr[i] as this is the value to which you want to update index ql[i] - 1 to.
Hope you find this helpful.
Thanks a lot it got submitted. But please try to reply fast.
Sure, sorry for the delay.
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.
Please can you help me with this one with an explaination -