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 U.V
import re
def brangelina(first: str, second: str) -> str:
print(first, second, end='-> ')
fs = r'([aeiou]+)'
f = list(re.finditer(fs, first))
s = list(re.finditer(fs, second))
leng = len(f)
f1 = first[:f[(leng == 1) + leng - 2].span()[0]]
f2 = second[s[0].span()[0]:]
print(f1, '+', f2)
return f1 + f2
July 16, 2024