Zsh, 68 bytes
-3 bytes thanks to @pxeger
for ((;#1;)){s=
for y ({A..Z})s+=${(Ml[1])1[1]%$y}&&1=${1#$y}
<<<$s}
(削除) Try it online!
(削除ここまで)
Try it online!
Append to $s a matched letter, padded to one character, in one statement, then removing the letter if it matches from the front of 1ドル.
GammaFunction
- 7.1k
- 14
- 24