help needed - ZCO13003 (CHEWING)

question link :
my code link :
getting WA…pls help me out !!

we can’t see your solution.Please share ideone link or pastebin link.

UPD:instead of writing your own binary search function you can use upper bound here which is easy to use.

misd to cmnt out debugging statements in dat link…ignore dat statements !

i donno about upperbound nd lower bounds…!!
if u dnt mind…pls explain it !!

I first learnt about upper bound and lower bound while solving this question.

this may help you

If you don’t understand look at sample codes and output then you will understand .

can u pls explain wts wrong wid my code ???

i think your code fails when the array contains duplicates

Here is my accepted solution

1 Like

can u pls debug my code and tell me d exact reason behind its fail…dat would become a great help bro !!

ok i will try