Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Ruby, 87+1 = 88 bytes

Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

Try it online!

#Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

Try it online!

Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

Try it online!

added 149 characters in body
Source Link
Value Ink
  • 13.5k
  • 1
  • 18
  • 46

#Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

TIO isn't working for me right now, so I'll probably get a link up later.Try it online!

#Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

TIO isn't working for me right now, so I'll probably get a link up later.

#Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

Try it online!

Source Link
Value Ink
  • 13.5k
  • 1
  • 18
  • 46

#Ruby, 87+1 = 88 bytes

Uses the -p flag.

gsub(/(\w+) (\w+)/){_,a,b=*$~;a[r=/[aeiouy]+/]&&b[r]?a.sub(r,b[r])+' '+b.sub(r,a[r]):_}

TIO isn't working for me right now, so I'll probably get a link up later.

AltStyle によって変換されたページ (->オリジナル) /