Skip to main content
-2 bytes, add explanation
Source Link
Surculose Sputum
  • 8.4k
  • 1
  • 13
  • 40

Python 3, 8983 8381 bytes

lambda a,b,c,d:g(*a)+g(*b)+c[0]+"-"+d[2:]
g=lambda c,*s:c[:c in"aeiou"andin"aeiou"]or c+g(*s)

Try it online!

-2 bytes thanks to @JonathanAllan!

Explanation:

g is a recursive function that takes in a splatted string and return the string, truncated after the first vowel.

  • lambda c,*s gather the splatted string into the first character c and the rest s.
  • c[:c in"aeiou"] or c+g(*s) evaluates to:
    • if c is a vowel, then c[:c in"aeiou"] evaluates to c[:1] which is c. Since c is Truthy, it is returned.
    • if c is not a vowel, then c[:c in"aeiou"] evaluates to c[:0] aka the empty string. The empty string is Falsy, so c+g(*s) (the recursive case) is returned.

**Old solution, kept here for sentimental reason** ### [Python 3], 89 bytes
lambda a,b,c,d:g(a)+g(b)+c[0]+"-"+d[2:]
g=lambda ors:s[:[x c+gin"aeiou"for x in s].index(*s1)+1]

Try it online!Try it online!

Python 3, 89 83 bytes

lambda a,b,c,d:g(*a)+g(*b)+c[0]+"-"+d[2:]
g=lambda c,*s:c in"aeiou"and c or c+g(*s)

Try it online!

Python 3, 83 81 bytes

lambda a,b,c,d:g(*a)+g(*b)+c[0]+"-"+d[2:]
g=lambda c,*s:c[:c in"aeiou"]or c+g(*s)

Try it online!

-2 bytes thanks to @JonathanAllan!

Explanation:

g is a recursive function that takes in a splatted string and return the string, truncated after the first vowel.

  • lambda c,*s gather the splatted string into the first character c and the rest s.
  • c[:c in"aeiou"] or c+g(*s) evaluates to:
    • if c is a vowel, then c[:c in"aeiou"] evaluates to c[:1] which is c. Since c is Truthy, it is returned.
    • if c is not a vowel, then c[:c in"aeiou"] evaluates to c[:0] aka the empty string. The empty string is Falsy, so c+g(*s) (the recursive case) is returned.

**Old solution, kept here for sentimental reason** ### [Python 3], 89 bytes
lambda a,b,c,d:g(a)+g(b)+c[0]+"-"+d[2:]
g=lambda s:s[:[x in"aeiou"for x in s].index(1)+1]

Try it online!

-6
Source Link
Surculose Sputum
  • 8.4k
  • 1
  • 13
  • 40

Python 3, 8989 83 bytes

lambda a,b,c,d:g(a*a)+g(b*b)+c[0]+"-"+d[2:]
g=lambda s:s[c,*s:[xc in"aeiou"forin"aeiou"and xc inor s].indexc+g(1*s)+1]

Try it online!Try it online!

Python 3, 89 bytes

lambda a,b,c,d:g(a)+g(b)+c[0]+"-"+d[2:]
g=lambda s:s[:[x in"aeiou"for x in s].index(1)+1]

Try it online!

Python 3, 89 83 bytes

lambda a,b,c,d:g(*a)+g(*b)+c[0]+"-"+d[2:]
g=lambda c,*s:c in"aeiou"and c or c+g(*s)

Try it online!

Source Link
Surculose Sputum
  • 8.4k
  • 1
  • 13
  • 40

Python 3, 89 bytes

lambda a,b,c,d:g(a)+g(b)+c[0]+"-"+d[2:]
g=lambda s:s[:[x in"aeiou"for x in s].index(1)+1]

Try it online!