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 14 characters in body
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, (削除) 115 (削除ここまで) (削除) 108 (削除ここまで) 38(削除) 38 (削除ここまで) 34 bytes

.+
$*¶
((?(1)¶1円|¶)\G¶|¶1円)+
01ドル
+T`_w¶`w_`.¶

Try it online! [Try it online!] (Includes test suite) Uses uppercase letters. Edit: Saved 70(削除) 70 (削除ここまで) 74 bytes by shamelessly adapting @MartinEnder's answer to Is this number triangular? Explanation: The number is converted into unary, then the largest possible triangular number is repeatedly matched until the number is exhausted. Each match is then converted into base 36.

Retina, (削除) 115 (削除ここまで) (削除) 108 (削除ここまで) 38 bytes

.+
$*¶
((?(1)¶1円|¶))+
01ドル
+T`_w¶`w_`.¶

Try it online! (Includes test suite) Uses uppercase letters. Edit: Saved 70 bytes by shamelessly adapting @MartinEnder's answer to Is this number triangular? Explanation: The number is converted into unary, then the largest possible triangular number is repeatedly matched until the number is exhausted. Each match is then converted into base 36.

Retina, (削除) 115 (削除ここまで) (削除) 108 (削除ここまで) (削除) 38 (削除ここまで) 34 bytes

.+
$*¶
(\G¶|¶1円)+
01ドル
+T`_w¶`w_`.¶

[Try it online!] (Includes test suite) Uses uppercase letters. Edit: Saved (削除) 70 (削除ここまで) 74 bytes by shamelessly adapting @MartinEnder's answer to Is this number triangular? Explanation: The number is converted into unary, then the largest possible triangular number is repeatedly matched until the number is exhausted. Each match is then converted into base 36.

added 179 characters in body
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, (削除) 115 (削除ここまで) 108(削除) 108 (削除ここまで) 38 bytes

.+
¶¶$&$*
{T`1-9l+`_o`^.+
}`^
z$*¶
\G.(?=(.*))
$&1ドル
{+`^(?=(.))((.)*¶.*)¶(?<-3>.1)*(?(3¶1円|¶)$.)+
2ドル1ドル¶01ドル
}`^[2-z]*+T`_w¶`w_`

Try it online! Try it online! (Includes test suite) Uses uppercase letters. Edit: Saved 70 bytes by shamelessly adapting @MartinEnder's answer to Is this number triangular? Explanation: The number is converted into unary, then the largest possible triangular number is repeatedly matched until the number is exhausted. Each match is then converted into base 36.

Retina, (削除) 115 (削除ここまで) 108 bytes

.+
¶¶$&$*
{T`1-9l+`_o`^.+
}`^
z
\G.(?=(.*))
$&1ドル
{+`^(?=(.))((.)*¶.*)¶(?<-3>.)*(?(3)$.)
2ドル1ドル¶
}`^[2-z]*

Try it online! (Includes test suite)

Retina, (削除) 115 (削除ここまで) (削除) 108 (削除ここまで) 38 bytes

.+
$*¶
((?(1)¶1円|¶))+
01ドル
+T`_w¶`w_`

Try it online! (Includes test suite) Uses uppercase letters. Edit: Saved 70 bytes by shamelessly adapting @MartinEnder's answer to Is this number triangular? Explanation: The number is converted into unary, then the largest possible triangular number is repeatedly matched until the number is exhausted. Each match is then converted into base 36.

added 242 characters in body
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, 115 bytes

Retina , (削除) 115 (削除ここまで) 108 bytes

.+
¶;$&$*¶¶$&$*
{T`1-9l+`_o`^.+
}`^
z
\G.(?=(.*))
$&1ドル;$&1ドル
{+`^(?=(.))((;|(.))*¶\w**¶.*);(?<-4>3>.)*(?(43)$.)
2ドル1ドル;2ドル1ドル¶
}`^\w+;`^[2-z]*.
T`¶;`_

Too slow for TIO I'm afraid.Try it online! (Change the z to something smaller to speed it up.Includes test suite)

Retina, 115 bytes

.+
¶;$&$*
{T`1-9l+`_o`^.+
}`^
z
\G.(?=(.*))
$&1ドル;
{+`^(?=(.))((;|(.))*¶\w*);(?<-4>.)*(?(4)$.)
2ドル1ドル;
}`^\w+;
T`¶;`_

Too slow for TIO I'm afraid. (Change the z to something smaller to speed it up.)

Retina , (削除) 115 (削除ここまで) 108 bytes

.+
¶¶$&$*
{T`1-9l+`_o`^.+
}`^
z
\G.(?=(.*))
$&1ドル
{+`^(?=(.))((.)*¶.*)(?<-3>.)*(?(3)$.)
2ドル1ドル¶
}`^[2-z]*.

Try it online! (Includes test suite)

Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290
Loading

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