fork download
  1. s1="aalkkaazylkkkkkkkasdakkkkkkkk"
  2. max_len=0
  3. current=0
  4.  
  5. for ch in s1:
  6. if ch=='k':
  7. current += 1
  8. if current > max_len:
  9. max_len = current
  10. else:
  11. current = 0
  12.  
  13. print(max_len)
Success #stdin #stdout 0.07s 14044KB
stdin
aalkkaaylkkkkkkkkkasddkkkrftgkkkkk
stdout
8