sort array of words by length code example
Example 1: javascript sorting array string by len
array.sort(function(a, b){return b.length - a.length});
Example 2: sort a vector of strings according to their length c++
std::vector<std::string> v;
std::sort(v.begin(), v.end(), []
(const std::string& first, const std::string& second){
return first.size() < second.size();
});