Getting WA in KRYP6

binary-search
c-plus-plus-14
extcontest
stl
wa

#1

Hi,

I don’t know where i am getting wrong with my code can anybody can figure it out please.

I am not getting why to use binary search in this question.


Link to the question.

Click here for my code

Thank’s a lot.


#2

can u please give the link to the question :slight_smile:


#3

I think you have not understood the question properly.
Try this test case :

5
5 4 1 2 3

Here your code fails .


#4

now i have provided you question link also.


#5

thank’s for that