Skip to main content
1 of 3
Dominic van Essen
  • 36.4k
  • 2
  • 22
  • 60

R, 57 bytes

function(s,t=s%in%utf8ToInt("aeiou"))s-t*32*!cumsum(t)%%2

Try it online!

Input is vector of character codes (for comparison to pajonk's answer). Would be 72 bytes with input as string (for comparison to Maël's answer).

Dominic van Essen
  • 36.4k
  • 2
  • 22
  • 60