import scala.
collection.
mutable.
PriorityQueue
val source
= Random.
shuffle("AABBCC".
permutations) val sorted
= ((PriorityQueue.
empty[String
] /
: source
){ _ +
= _ }).
reverse.
dequeueAll sorted foreach println
}
aW1wb3J0IHNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5Qcmlvcml0eVF1ZXVlCmltcG9ydCBzY2FsYS51dGlsLlJhbmRvbQoKb2JqZWN0IE1haW4gZXh0ZW5kcyBBcHAgewoKICB2YWwgc291cmNlID0gUmFuZG9tLnNodWZmbGUoIkFBQkJDQyIucGVybXV0YXRpb25zKQogIHZhbCBzb3J0ZWQgPSAoKFByaW9yaXR5UXVldWUuZW1wdHlbU3RyaW5nXSAvOiBzb3VyY2UgKXsgXyArPSBfIH0pLnJldmVyc2UuZGVxdWV1ZUFsbAogIHNvcnRlZCBmb3JlYWNoIHByaW50bG4KCn0=