• Check fail on Largest Histogram

 

I would like to give some feedback about Check fail on Largest Histogram. My code passes the basic run but fails on extra without specifying the reason. I it is not clear what is wrong with the code in case if there is a reason why it doesn't pass extra check.

My code is the following:

def largest_histogram(histogram): histo = histogram[0] for i in range(len(histogram)): try: if histogram[i]+histogram[i+1] > histo: histo = min(histogram[i], histogram[i + 1]) * 2 except IndexError: if histo < len(histogram): histo = len(histogram) return histo

From: https://py.checkio.org/mission/largest-histogram/solve/

HTTP_USER_AGENT:

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0