• + 0 comments

    i tried to solve this using numpy lib with python3. it is showing me runtime error. it's working in my jupiter notebook though.!!

    import numpy as np

    def hourglassSum(arr):

    arr1 = np.array(arr)
    f=[]
    for i in range(4):
        for j in range(4):
            g= (sum(arr1[i][:j+3])+sum(arr1[i+1][:j+3])+sum(arr1[i+2][:j+3]))
            f.append(g)
    return max(f)