Very Simple 13 line solution


#1
def solve(self, a):
    n,m,ans = len(a),len(a[0]),a
    for j in range(m):
        cnt = 0
        for i in range(n):
            if a[i][j]==1:cnt+=1
            if ans[i][j]==0:cnt =0
            ans[i][j]=cnt
    for i in range(n):ans[i].sort(reverse=True)
    ans  = 0
    for i in range(n):
        for j in range(m):
            if a[i][j]!=0:ans = max(ans,a[i][j]*(j+1))
    return ans

Happy Coding :smile: