String sort problem

compilation error is coming

@guptarahul3100 you are passing strings as argument ro your comparator function but are writing them as int during function definition and trying to use string functions like length on them. So please make this change.

bool compare(string a,string b ){

thank you Keshav Gupta