C++ | SORT+COMPARATOR | IMPORTENCE OF "STATIC"
\n**Sort  with an extra parameter [Comapare fun , it compares two string :\n1) if both have same length , then it returns true if 1st string >2nd string (lexiog
\n**Sort  with an extra parameter [Comapare fun , it compares two string :\n1) if both have same length , then it returns true if 1st string >2nd string (lexiographically)\n2) if length are different , then it returns true if lenght of the 1st string > length of the 2nd string.\ndon\'t forget to use static keyword] \n\n```\nprivate:\n    \n    static bool RC(string &a , string &b)\n    {\n        \n                 int x=a.size();\n         int y=b.size();\n        \n        if(x==y)return (a>b);\n        \n        return (x>y);\n        \n    }\n    \n\n    \npublic:\n    string kthLargestNumber(vector<string>& nums, int k) { \n        int n=nums.size();\n        \n        sort(nums.begin(),nums.end(),RC);  \n        \n//   for(auto &i : nums)cout<<i<<endl;    \n        \n        \n    return nums[--k];\n        \n    }\n```
['Sorting']