Last active
August 29, 2015 14:23
-
-
Save efuquen/6603a8e2be1ff2b53c2b 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 = "" | |
longest_alpha_str = "" | |
for letter in s: | |
if cur_alpha_str == "" or letter > cur_alpha_str[-1]: | |
cur_alpha_str += letter | |
else: | |
if len(cur_alpha_str) > len(longest_alpha_str): | |
longest_alpha_str = cur_alpha_str | |
cur_alpha_str = str(letter) | |
if len(cur_alpha_str) > len(longest_alpha_str): | |
longest_alpha_str = cur_alpha_str | |
print longest_alpha_str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment