Find upper and lower bound

could you please help me in understanding what is wrong in this code

thanks in advance!

hello @mridulpant please wait i will go through your code and let you know the error .

ok,let me know…once it is don

@mridulpant see this :

ok, but once iam trying to submit the below corrected code in hacker blocks most of my test cases are failing

what is the error it is showing ?

test cases are failing

@mridulpant on test cases what it is showing ?

why you dont try to solve them in c++?

run error is coming up for failed test cases

i tried running it with c++ also, only2 test cases are passing rest all are coming as failed with run error: kindly look ,https://ide.codingblocks.com/s/380544

share your c++ code .


@mridulpant try this it is passing every test case.
Happy Learning !!

yes, i havejust updated the array size while declaring in the c++ code and itworked expected but can you please help me in understanding what could be the reason for python code ,why it failed for few test cases: https://ide.codingblocks.com/s/380507

hey @mridulpant i think python code is not optimized.
your code is taking more run time.That is why it is giving run error.

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.