#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; bool compare(const pair<char, int>& a, const pair<char, int>& b) { return a.second > b.second; } int beauty(string s) { int sum = 0, value = 26...