Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Even the Last by Damian_Horna
def checkio(array):
if not array:
return 0
if len(array)==0 and array[0]==0:
return 0
if len(array)==0 and array[0]!=0:
return array[0]*array[0]
if len(array)>0:
y=0
for x in range(0,len(array),2):
y+=array[x]
return y*array[len(array)-1]
Oct. 14, 2016