Help rahul to search?can someone please tell me what i am doing wrong

Hello @sarthaksingh,

  1. The value of k will be n-1 always:
    The logic you have applied to find the point of discontinuity is wrong.

  2. The value of s and e in the if and else statements should be k and k-1 resp.

I have modified your code:

Hope, this would help.
Give a like, if you are satisfied.