Unable to do this ques


my code ide pls check and tell me the error , actually i am getting ans !=sum of no. pages and also getting segmentation fault on coding block ide but not getting segmentation fault neither here nor on any other compiler

pls once check my code !!!

Hello @Shubham800 i have corrected your code:


in this range should be from the book with the maximum number of pages to the sum of all the pages.
as you are given that the array given will be in ascending order os directly take the last element.
if you have any doubt you can ask here:
Happy Learning!!

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.