Skip to content

Instantly share code, notes, and snippets.

@calizarr
Created January 14, 2013 04:53
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 calizarr/4527846 to your computer and use it in GitHub Desktop.
Save calizarr/4527846 to your computer and use it in GitHub Desktop.
def findDecreaseStrip(perm,start,lst):
if start>len(perm)-1 or start+1>len(perm)-1:
return lst
breakpoint = abs(perm[start+1]-perm[start])
if start+1==len(perm)-1 and perm[start]>perm[start+1] and breakpoint==1:
lst.append(start),lst.append(start+1)
elif perm[start]>perm[start+1] and breakpoint==1:
lst.append(start)
return findDecreaseStrip(perm,start+1,lst)
else:
return lst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment