Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
recursive solution in Clear category for Largest Rectangle in a Histogram by gyahun_dash
from itertools import groupby
def largest_histogram(bins):
minf = min(bins)
subs = (list(s) for key, s in groupby(bins, key=lambda f: f > minf) if key)
return max(minf * len(bins), max(map(largest_histogram, subs), default=0))
Oct. 25, 2016