Skip to main content
Removed the char count as this is not a gold challenge
Source Link
elssar
  • 599
  • 4
  • 17

Python (114 chars)

def s(n):
l=0
t=1
for i in range(0,9):
    if n[i]+1==n[i+1]:
        t+=1
    else:
        if l<t:
            l=t
        t=1
return l

Python (114 chars)

def s(n):
l=0
t=1
for i in range(0,9):
    if n[i]+1==n[i+1]:
        t+=1
    else:
        if l<t:
            l=t
        t=1
return l

Python

def s(n):
l=0
t=1
for i in range(0,9):
    if n[i]+1==n[i+1]:
        t+=1
    else:
        if l<t:
            l=t
        t=1
return l
Source Link
elssar
  • 599
  • 4
  • 17

Python (114 chars)

def s(n):
l=0
t=1
for i in range(0,9):
    if n[i]+1==n[i+1]:
        t+=1
    else:
        if l<t:
            l=t
        t=1
return l