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

added 102 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 21
  • 63

Python 2, (削除) 88 (削除ここまで) 85(削除) 85 (削除ここまで)(削除) 84 (削除ここまで) 77 bytes

f=lambda x,y,d='.':y in x and y*x.count(y)+'.'+f+d+f(y,x.replace(y,'')).replace('.','')or' .'+x'+d+x

Try it online! Try it online!


Saved

  • -1 byte, thanks to LyricLy
  • -7 bytes, thanks to Dead Possum

Python 2, (削除) 88 (削除ここまで) 85 bytes

f=lambda x,y:y in x and y*x.count(y)+'.'+f(y,x.replace(y,'')).replace('.','')or' .'+x

Try it online!

Python 2, (削除) 88 (削除ここまで) (削除) 85 (削除ここまで)(削除) 84 (削除ここまで) 77 bytes

f=lambda x,y,d='.':y in x and y*x.count(y)+d+f(y,x.replace(y,''),'')or' '+d+x

Try it online!


Saved

  • -1 byte, thanks to LyricLy
  • -7 bytes, thanks to Dead Possum
deleted 1 character in body
Source Link
TFeld
  • 19.9k
  • 3
  • 21
  • 63

Python 2, 86(削除) 88 (削除ここまで) 85 bytes

lambdaf=lambda x,y:(y in x and y*x.count(y)+'.'+f(y,x.replace(y,'')).replace('.',''))if y in x else'or' .'+x

Try it online! Try it online!

Python 2, 86 bytes

lambda x,y:(y*x.count(y)+'.'+f(y,x.replace(y,'')).replace('.',''))if y in x else' .'+x

Try it online!

Python 2, (削除) 88 (削除ここまで) 85 bytes

f=lambda x,y:y in x and y*x.count(y)+'.'+f(y,x.replace(y,'')).replace('.','')or' .'+x

Try it online!

Post Undeleted by TFeld
added 41 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 21
  • 63

Python 2, (削除) 55 (削除ここまで)(削除) 51 (削除ここまで) 4986 bytes

lambda x,y:(y*x.count(y)+'. '+y'+f(y,x.replace(y,'')*).replace('.',''))if y in x)or' else' .'+x

Try it online! Try it online!

Python 2, (削除) 55 (削除ここまで)(削除) 51 (削除ここまで) 49 bytes

lambda x,y:(y*x.count(y)+'. '+y)*(y in x)or' .'+x

Try it online!

Python 2, 86 bytes

lambda x,y:(y*x.count(y)+'.'+f(y,x.replace(y,'')).replace('.',''))if y in x else' .'+x

Try it online!

Post Deleted by TFeld
Source Link
TFeld
  • 19.9k
  • 3
  • 21
  • 63
Loading

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