#Smalltalk, 138#
Smalltalk, 138
input in s:
m:=(s select:[:c|cisLetter])asLowercase asBag sortedCounts map:#value.
i:=($ato:$z).m:=m,(i copyWithoutAll:m).
s copyTransliterating:i to:m
the decoder is:
s copyTransliterating:m to:i
but as (if I understand correctly) I may not reuse "i" and "m", I'll golf without it. Code above has two additional CRs inserted for readability, which were uncounted in the char count.
#Smalltalk, 138#
input in s:
m:=(s select:[:c|cisLetter])asLowercase asBag sortedCounts map:#value.
i:=($ato:$z).m:=m,(i copyWithoutAll:m).
s copyTransliterating:i to:m
the decoder is:
s copyTransliterating:m to:i
but as (if I understand correctly) I may not reuse "i" and "m", I'll golf without it. Code above has two additional CRs inserted for readability, which were uncounted in the char count.
Smalltalk, 138
input in s:
m:=(s select:[:c|cisLetter])asLowercase asBag sortedCounts map:#value.
i:=($ato:$z).m:=m,(i copyWithoutAll:m).
s copyTransliterating:i to:m
the decoder is:
s copyTransliterating:m to:i
but as (if I understand correctly) I may not reuse "i" and "m", I'll golf without it. Code above has two additional CRs inserted for readability, which were uncounted in the char count.
#Smalltalk, 138#
input in s:
m:=(s select:[:c|cisLetter])asLowercase asBag sortedCounts map:#value.
i:=($ato:$z).m:=m,(i copyWithoutAll:m).
s copyTransliterating:i to:m
the decoder is:
s copyTransliterating:m to:i
but as (if I understand correctly) I may not reuse "i" and "m", I'll golf without it. Code above has two additional CRs inserted for readability, which were uncounted in the char count.