• + 0 comments
    def pageCount(n, p):
        # Write your code here
        if p%2==0:
            start = 1+(p-2)//2
            end = (n-p)//2
        if p%2==1:
            start = (p-1)//2
            end = (n+1-p)//2
        
        return min(start,end)