We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
deflargestRectangle(h):# Write your code heremaxx=0foriinrange(len(h)):j=iwhile(j<len(h)andh[j]>=h[i]):j+=1k=(j-i)j=iwhile(j>-1andh[j]>=h[i]):j-=1k+=(i-1-j)maxx=max(maxx,h[i]*k)returnmaxx
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Largest Rectangle
You are viewing a single comment's thread. Return to all comments →