Very Easy Python Soln


#1
#  A : list of integers
#  B : list of integers

def coverPoints(self, A, B):
    n=len(A)
    st1=0
    for i in range(1,n):
        xdiff=A[i]-A[i-1]
        if(xdiff<0):
            xdiff=xdiff*(-1)
        ydiff=B[i]-B[i-1]
        if(ydiff<0):
            ydiff=ydiff*(-1)
        c=max(xdiff,ydiff)
        st1=st1+c
    return st1