Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Re solution in Clear category for Combining Celebrity Names by amandel
import re
def brangelina(first: str, second: str) -> str:
return re.split('[aeiou]+',first[::-1],maxsplit=2)[-1][::-1]+re.search('[aeiou].*',second).group(0)
print("Example:")
print(brangelina("brad", "angelina"))
# These "asserts" are used for self-checking
assert brangelina("brad", "angelina") == "brangelina"
assert brangelina("angelina", "brad") == "angelad"
assert brangelina("sheldon", "amy") == "shamy"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Sept. 18, 2023
Comments: