/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Map
<String,Integer
> freqMap
= new HashMap
<String,Integer
>(); freqMap.put("quick", 11);
freqMap.put("brown", 3);
freqMap.put("fox", 6);
freqMap.put("jumps", 8);
freqMap.put("over", 1);
freqMap.put("the", 20);
freqMap.put("lazy", 4);
freqMap.put("dog", 6);
freqMap.entrySet()
);
entries
,
new Comparator
<Map.
Entry<String,Integer
>>() { return Integer.
compare(b.
getValue(), a.
getValue()); }
}
);
for (Map.
Entry<String,Integer
> e
: entries
) { System.
out.
println(e.
getKey()+":"+e.
getValue()); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCU1hcDxTdHJpbmcsSW50ZWdlcj4gZnJlcU1hcCA9IG5ldyBIYXNoTWFwPFN0cmluZyxJbnRlZ2VyPigpOwoJCWZyZXFNYXAucHV0KCJxdWljayIsIDExKTsKCQlmcmVxTWFwLnB1dCgiYnJvd24iLCAzKTsKCQlmcmVxTWFwLnB1dCgiZm94IiwgNik7CgkJZnJlcU1hcC5wdXQoImp1bXBzIiwgOCk7CgkJZnJlcU1hcC5wdXQoIm92ZXIiLCAxKTsKCQlmcmVxTWFwLnB1dCgidGhlIiwgMjApOwoJCWZyZXFNYXAucHV0KCJsYXp5IiwgNCk7CgkJZnJlcU1h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