Last active
March 15, 2019 16:51
-
-
Save eloytoro/5d3fcc6b68e6c1b9c303d32e0544fa92 to your computer and use it in GitHub Desktop.
This file contains 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
def higher(text): | |
text = text.replace(" ", "") | |
count = 0 | |
for char in text: | |
current_count = text.count(char) | |
if current_count > count: | |
count = current_count | |
last = char | |
return text.replace(last, "") | |
print(higher("uk aaaa aaaa eeee iiii eeee iiii ku")) | |
print(higher("otro texto")) | |
// varias veces el mismo texto | |
print(higher(higher("uk aaaa aaaa eeee iiii eeee iiii ku"))) | |
print(higher(higher(higher("uk aaaa aaaa eeee iiii eeee iiii ku")))) |
Author
eloytoro
commented
Mar 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment