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 Revisions

3 of 3
-4 Thanks @Shaggy
Shieru Asakoto
  • 6.5k
  • 19
  • 43

JavaScript (Node.js), (削除) 38 (削除ここまで) (削除) 36 (削除ここまで) 32 bytes

(削除) s=>s.replace(/(.)(.)( |$)/g,"2ドル1ドル ") (削除ここまで)
s=>s.replace(/(.)(.)\b/g,"2ドル1ドル")

Try it online!

RegExp approach courtesy @Giuseppe (although I thought of this independently), assuming words separated by only one space

-2 for only considering 1 space and add trailing space

-4 Thanks @Shaggy

Shieru Asakoto
  • 6.5k
  • 19
  • 43

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