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
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.
Zsh, 4968 bytes
jot((1ドル<6&&2ドル<6))&&jot -b00000 5|sed "1ドル s/./3ドル/2ドル"|grep -z "3ドル"|tac"3ドル"|tac||e
Correction and improvement to the bash solution, with bounds checks.