Skip to content

Instantly share code, notes, and snippets.

@yask123
Created January 21, 2016 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yask123/2c42935e99e6e5ab7ad1 to your computer and use it in GitHub Desktop.
Save yask123/2c42935e99e6e5ab7ad1 to your computer and use it in GitHub Desktop.
ls = [-1, -2, 1, 3, 2]
maxx = ls[0]*ls[1]*ls[2]
for i in range(len(ls)-2):
prod=1
for j in range(i,i+3):
prod*=ls[j]
if maxx < prod:
maxx = prod
print maxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment