" Your code might be failing for larger test-cases " and hence partial score


#1

Comment body goes here.`class Solution:
# @param A : tuple of integers
# @param B : integer
# @return an integer
def search(self, a, b):
s=0
e=len(a)-1
piv=-1
while s<=e:

        if a[s]<a[e]:
            piv=s
            
            break
        mid=(s+e)//2
        p=(mid+len(a)-1)%len(a)
        n=(mid+1)%len(a)
        if a[p]>a[mid] and a[n]>a[mid]:
            piv=mid
            break
        elif a[mid]<a[e]:
            e=mid-1
        else:
            s=mid+1
    
    #return(piv)
    #print(a[piv-1])
    
    try:
        o=a.index(b)
    except:
        return -1
    if a[0]==b:
        return 0
    
    if a.index(b)<=a.index(a[piv-1]):
        s=0
        e=piv-1
        while s<=e:
            mid=(s+e)//2
            if a[mid]==b:
                return mid
            elif a[mid]<b:
                s=mid+1
            else:
                e=mid-1
    else:
        s=piv
        e=len(a)-1
        while s<=e:
            mid=(s+e)//2
            if a[mid]==b:
                return mid
            elif a[mid]<b:
                s=mid+1
            else:
                e=mid-1

`