Last active
August 29, 2015 14:23
-
-
Save efuquen/6d0aa52ba73f56ff7d78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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