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

deleted 63 characters in body
Source Link
0xffcourse
  • 2.8k
  • 3
  • 15
  • 27

Python 3, (削除) 198 (削除ここまで) (削除) 196 (削除ここまで) 194192 bytes

  • Saved 46 bytes: thanks to Zachary T : if(m and n) to if m and n & removed unwanted r for regex string, index i starting from 1 instead of 0

I don't know why, but it isn't working on TIO somehow! Working on python 3.6 on PC though!

from re import*
s=search
a=input().split()
v="[aeiouy]+"
j=1
while j<len(a):
 i=j-1;m=s(v,a[j]);n=s(v,a[i])
 if m and n:a[i]=sub(v,m[0],a[i],1);a[j]=sub(v,n[0],a[j],1)
 j+=2
print(' '.join(a))

Try it online! Try it online!

Python 3, (削除) 198 (削除ここまで) (削除) 196 (削除ここまで) 194 bytes

  • Saved 4 bytes: thanks to Zachary T : if(m and n) to if m and n & removed unwanted r for regex string, index i starting from 1 instead of 0

I don't know why, but it isn't working on TIO somehow! Working on python 3.6 on PC though!

from re import*
s=search
a=input().split()
v="[aeiouy]+"
j=1
while j<len(a):
 i=j-1;m=s(v,a[j]);n=s(v,a[i])
 if m and n:a[i]=sub(v,m[0],a[i],1);a[j]=sub(v,n[0],a[j],1)
 j+=2
print(' '.join(a))

Try it online!

Python 3, (削除) 198 (削除ここまで) (削除) 196 (削除ここまで) 192 bytes

  • Saved 6 bytes: thanks to Zachary T : if(m and n) to if m and n & removed unwanted r for regex string, index i starting from 1 instead of 0
from re import*
s=search
a=input().split()
v="[aeiouy]+"
j=1
while j<len(a):
 i=j-1;m=s(v,a[j]);n=s(v,a[i])
 if m and n:a[i]=sub(v,m[0],a[i],1);a[j]=sub(v,n[0],a[j],1)
 j+=2
print(' '.join(a))

Try it online!

[Edit removed during grace period]
Source Link
0xffcourse
  • 2.8k
  • 3
  • 15
  • 27
added 59 characters in body
Source Link
0xffcourse
  • 2.8k
  • 3
  • 15
  • 27

Python 3, (削除) 198 (削除ここまで) 196(削除) 196 (削除ここまで) 194 bytes

  • Saved 24 bytes: thanks to Zachary T : if(m and n) to if m and n & removed unwanted r for regex string, index i starting from 1 instead of 0

I don't know why, but it isn't working on TIO somehow! Working on python 3.6 on PC though!

from re import*
s=search
a=input().split()
v="[aeiouy]+"
i=0j=1
while i+1<lenj<len(a):
 j=i+1;m=si=j-1;m=s(v,a[j]);n=s(v,a[i])
 if m and n:a[i]=sub(v,m[0],a[i],1);a[j]=sub(v,n[0],a[j],1) 
 i+=2j+=2 
print(' '.join(a))

Try it online!

Python 3, (削除) 198 (削除ここまで) 196 bytes

  • Saved 2 bytes: thanks to Zachary T : if(m and n) to if m and n & removed unwanted r for regex string

I don't know why, but it isn't working on TIO somehow! Working on python 3.6 on PC though!

from re import*
s=search
a=input().split()
v="[aeiouy]+"
i=0
while i+1<len(a):
 j=i+1;m=s(v,a[j]);n=s(v,a[i])
 if m and n:a[i]=sub(v,m[0],a[i],1);a[j]=sub(v,n[0],a[j],1) 
 i+=2 
print(' '.join(a))

Try it online!

Python 3, (削除) 198 (削除ここまで) (削除) 196 (削除ここまで) 194 bytes

  • Saved 4 bytes: thanks to Zachary T : if(m and n) to if m and n & removed unwanted r for regex string, index i starting from 1 instead of 0

I don't know why, but it isn't working on TIO somehow! Working on python 3.6 on PC though!

from re import*
s=search
a=input().split()
v="[aeiouy]+"
j=1
while j<len(a):
 i=j-1;m=s(v,a[j]);n=s(v,a[i])
 if m and n:a[i]=sub(v,m[0],a[i],1);a[j]=sub(v,n[0],a[j],1) 
 j+=2 
print(' '.join(a))

Try it online!

added 201 characters in body
Source Link
0xffcourse
  • 2.8k
  • 3
  • 15
  • 27
Loading
Source Link
0xffcourse
  • 2.8k
  • 3
  • 15
  • 27
Loading

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