If anybody facing this problem then do not call a BS function instead do an iterative BS within the same Search funtion only. It worked for me after wasting 2 hrs
" Your code might be failing for larger test-cases " and hence partial score - Solved
May be you are passing your array using pass by value which takes O(n) time itself.