def isConsecutive4(s):
....s=[int(x) for x in s]
....count,i,tmp = 1,0,s[0]
....while i < len(s) - 1:
........if s[i] == tmp+1:
............count+=1
........else:
............count=1
........if count > 3:return True
........tmp=s[i]
........i+=1
....return False
if __name__ == '__main__':
....print(isConsecutive4('52678908623'))
....print(isConsecutive4('54312234732'))
只看升序吗
连续多少个?
《乾隆抄本百廿回红楼梦稿》,咸丰年间于源题曰“红楼梦稿”,杨继振旧藏,亦称“杨藏本”、“脂稿本”。第78