How calculating p2 vector as for my cde

s.queryMin(0,8); 

Give segmentation fault as our range is of legth 9 and in
pw=p2(8) gives 4

and 2^4==16 but sir has taught to find min in this same way but it will going to give segmentation fault in many cases

and will work for
s.queryMin(0,7);

But how to do for other such as (0,9)

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.

You have not even replay yet ??

@yaduvanshii092
if your doubt is still not cleared, you can reopen your doubt from the portal. Please click on “Mark as resolved” and then on the same page, click “ReOpen doubt”.

Your doubt will go back to the open pool and taken by any other TA.

Please Help still does not got how to calculate for legnth greater than 8 as in pw calculation?