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 111 characters in body
Source Link
Martin Ender
  • 198.2k
  • 67
  • 455
  • 998

Retina , 25 bytes

Retina , (削除) 25 (削除ここまで) 20 bytes

+`^.*(.).*¶(?=.*1円)
2ドル
^.+$

Try it online! Try it online!

That'sWhenever we find a fairly disappointing score, but I'm having trouble coming up with something better. The idea isdigit that also occurs in the next number, we repeatedly remove the first number if it shares a digitseparator between those numbers (along with the seconddigits in the former number, starting from the shared one, but that's irrelevant). AtThe input is valid, if all separators have been remove in the endprocess, which we check by making sure that there is only one number leftthe string can be matched as a single line.

Retina , 25 bytes

+`^.*(.).*¶(.*1円)
2ドル
^.+$

Try it online!

That's a fairly disappointing score, but I'm having trouble coming up with something better. The idea is that we repeatedly remove the first number if it shares a digit with the second number. At the end we check that there is only one number left.

Retina , (削除) 25 (削除ここまで) 20 bytes

(.).*¶(?=.*1円)
^.+$

Try it online!

Whenever we find a digit that also occurs in the next number, we remove the separator between those numbers (along with the digits in the former number, starting from the shared one, but that's irrelevant). The input is valid, if all separators have been remove in the process, which we check by making sure that the string can be matched as a single line.

Source Link
Martin Ender
  • 198.2k
  • 67
  • 455
  • 998

Retina, 25 bytes

+`^.*(.).*¶(.*1円)
2ドル
^.+$

Try it online!

That's a fairly disappointing score, but I'm having trouble coming up with something better. The idea is that we repeatedly remove the first number if it shares a digit with the second number. At the end we check that there is only one number left.

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