BIT 9 UPDATE IT Query doubt

In this question we need to update the range from l to r with a value and then print any ith element from the array.

Update part is easy but in the query part, the video says that we will print the cumulative sum till the ith element.

But that will give me the cumulative sum and the question says that we need to print the ith element, for ex i want to print 7th element, then according to algo, the code will print range(1-4)+range(5-6)+range(7). But thats the cumulative sum, i want to print 7th element.

Hi

@bobby667788 please ask this doubt through ask doubt in your online section, i’m not able to view this in my portal.

BIT 9 UPDATE IT Query doubt
In this question we need to update the range from l to r with a value and then print any ith element from the array. Update part is easy but in the query part, the video says that we will print the cumulative sum till the ith element. But that will give me the cumulative sum and the question says that we need to print the ith element, for ex i want to print 7th element, then according to algo, the code will print range(1-4)+range(5-6)+range(7). But thats the cumulative sum, i want to print 7th element.

BIT 9 UPDATE IT Query doubt
In this question we need to update the range from l to r with a value and then print any ith element from the array. Update part is easy but in the query part, the video says that we will print the cumulative sum till the ith element. But that will give me the cumulative sum and the question says that we need to print the ith element, for ex i want to print 7th element, then according to algo, the code will print range(1-4)+range(5-6)+range(7). But thats the cumulative sum, i want to print 7th element.

It has been more than six days since i asked this question, my doubt has not been resolved yet, when will my doubt be resolved your website says that they are resolved within 24 hours. whats going on?

if you want to print the seventh element then take cumulative sum till 7th element and subract cumulative sum till 6th element .
you will get the value of the seventh element .

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.