Skip to content

Instantly share code, notes, and snippets.

@eloytoro
Last active March 15, 2019 16:51
Show Gist options
  • Save eloytoro/5d3fcc6b68e6c1b9c303d32e0544fa92 to your computer and use it in GitHub Desktop.
Save eloytoro/5d3fcc6b68e6c1b9c303d32e0544fa92 to your computer and use it in GitHub Desktop.
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"))))
@eloytoro
Copy link
Author

sample="uk aaaa aaaa eeee iiii eeee iiii ku"
print(sample)
sample = higher(sample)
print(sample)
sample = higher(sample)
print(sample)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment