###Ruby, (削除) 104 (削除ここまで)(削除) 92 (削除ここまで) 91 characters###
Ruby, (削除) 104 (削除ここまで)(削除) 92 (削除ここまで) 91 characters
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'',l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, (削除) 104 (削除ここまで)(削除) 92 (削除ここまで) 91 characters###
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'',l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
Ruby, (削除) 104 (削除ここまで)(削除) 92 (削除ここまで) 91 characters
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'',l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, (削除) 104 (削除ここまで) 92(削除) 92 (削除ここまで) 91 characters###
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'',l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, (削除) 104 (削除ここまで) 92 characters###
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'',l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, (削除) 104 (削除ここまで) (削除) 92 (削除ここまで) 91 characters###
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'',l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, 104(削除) 104 (削除ここまで) 92 characters###
def f(s)m=("a".."z").to_a;l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m.join, l.sort.transpose[1].join)end
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'', l.sort.transpose[1]*'')}
Online Version Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, 104 characters###
def f(s)m=("a".."z").to_a;l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m.join, l.sort.transpose[1].join)end
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.
###Ruby, (削除) 104 (削除ここまで) 92 characters###
Saved quite a few characters thanks to @Chron
f=->(s){m=[*?a..?z];l=m.map{|x|[-s.downcase.count(x),x]};s.tr(m*'', l.sort.transpose[1]*'')}
Online Version here. Sorting of characters with the same count is not defined, as mentioned in another answer. With the input "asdf", each answer has another output so far.
In other words: all answers have the same behaviour (thus represent a decodable encoding) when the input contains the whole alphabet with each letter having a unique count.