Please tell me what m doing wrong , some testcases are passing

code:

@myself.yash.srivastav
As mentioned in the problem constraints , N can be as large as 10^15. You are trying to make an array of this size. This is not allowed. C++ does not allow you to make arrays of such large sizes. Also the thing is , you don’t need to. You are only storing counting in this array which has not importance really.
Also in case when s>e , return -1 instead of mid.