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 227 characters in body
Source Link
roblogic
  • 4.6k
  • 21
  • 24

Zsh, 68(削除) 68 (削除ここまで) 55 bytes

((1ドル<6&&2ドル<6))&&jot -b00000 5|sed "1ドル"2ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac||e1ドル"|tac||e

Try it online! Try it online! (削除) 68b (削除ここまで)

Correction and improvement to the bash solutionIf 1ドル or 2ドル are more than 5, with bounds checksZsh throws command not found: e. If they are 0 or less, sed throws an error.

Zsh, 68 bytes

((1ドル<6&&2ドル<6))&&jot -b00000 5|sed "1ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac||e

Try it online!

Correction and improvement to the bash solution, with bounds checks.

Zsh, (削除) 68 (削除ここまで) 55 bytes

((1ドル<6&&2ドル<6))&&jot -b00000 5|sed "2ドル s/./3ドル/1ドル"|tac||e

Try it online! (削除) 68b (削除ここまで)

If 1ドル or 2ドル are more than 5, Zsh throws command not found: e. If they are 0 or less, sed throws an error.

added 75 characters in body
Source Link
roblogic
  • 4.6k
  • 21
  • 24

Zsh, 4968 bytes

jot((1ドル<6&&2ドル<6))&&jot -b00000 5|sed "1ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac"3ドル"|tac||e

Try it online! Try it online!

Correction and improvement to the bash solution, with bounds checks.

Zsh, 49 bytes

jot -b00000 5|sed "1ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac

Try it online!

Correction and improvement to the bash solution.

Zsh, 68 bytes

((1ドル<6&&2ドル<6))&&jot -b00000 5|sed "1ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac||e

Try it online!

Correction and improvement to the bash solution, with bounds checks.

Source Link
roblogic
  • 4.6k
  • 21
  • 24

Zsh, 49 bytes

jot -b00000 5|sed "1ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac

Try it online!

Correction and improvement to the bash solution.

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