Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re.findall, match solution in Clear category for Combining Celebrity Names by kurosawa4434
from re import findall, match
def brangelina(first: str, second: str) -> str:
if len(findall('[aiueo]+', first)) == 1:
head = match('(.*)[aiueo]+', first).group(1)
else:
head = match('(.*)[aiueo]+[^aiueo]+[aiueo]+', first).group(1)
tail = match('[^aiueo]*(.*)', second).group(1)
return head + tail
Sept. 18, 2023
Comments: