Created
January 14, 2013 04:53
-
-
Save calizarr/4527846 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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