Skip to content

Instantly share code, notes, and snippets.

@efuquen
Last active August 29, 2015 14:23
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 efuquen/6d0aa52ba73f56ff7d78 to your computer and use it in GitHub Desktop.
Save efuquen/6d0aa52ba73f56ff7d78 to your computer and use it in GitHub Desktop.
cur_alpha_str = ""
long_alpha_str = ""
for c in s:
if len(cur_alpha_str) == 0 or c >= cur_alpha_str[-1]:
cur_alpha_str += str(c)
else:
if len(cur_alpha_str) > len(long_alpha_str):
long_alpha_str = cur_alpha_str
cur_alpha_str = str(c)
if len(cur_alpha_str) > len(long_alpha_str):
long_alpha_str = cur_alpha_str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment