Untitled

Anonymous
plain_text
11/22/2022 3:01 PM
320 B
19
Indexable
bool comp(string a, string b) {
    if(a.size() != b.size()) return a.size() < b.size();
    
    return a.compare(b) < 0;
}

vector<string> numSort(int n , vector<string >& a){
    sort(a.begin(), a.end(), comp);
    return a;
}
Editor is loading...