Cpp || Easy-Solution || Linear Solution || Priority_queue
This problem is simillar to the problem where we need to find out the kth largest/smallest provided the elements of the array are integer\n\n\nProblem here is s
**This problem is simillar to the problem where we need to find out the kth largest/smallest provided the elements of the array are integer**\n\n\n**Problem here is similar but instead of int/float i.e numerical value we have string representing that value**\n\n**one idea may come like converting the string into equivalent numerical value using std::stoi()\nbut it would be better if we use basic concept of number system**\n\n**say a & b are two number need to be compare :**\n\n**a>b if a.length() >b.length()\na<b  if b.length()>a.length()\na.length()==b.length() two case we will start compare from MSB side i.e left to right\nif all same return true otherwise return a>b if(a[i]>b[i]) else b>a**\n\n**these lines will be more clear from code **\n\n**Since we are using priority_queue we need to pass customise comparator **\n\n```\nclass cmp\n{\n    public:\n    bool operator()(string &a,string &b)\n    {\n        int m=a.length(),n=b.length();\n        if(m!=n)\n        {\n            return m>n;\n        }\n        \n        int i=0;\n        while(i<n)\n        {\n            if(a[i]!=b[i])\n            {\n                return a[i]>b[i];\n            }\n            i++;\n        }\n        \n        return true;\n    }\n};\nclass Solution {\nprivate :\n\npublic:\n    string kthLargestNumber(vector<string>& nums, int k)\n    {\n        \n        priority_queue<string,vector<string>,cmp> q;\n        for(auto num:nums)\n        {\n            q.push(num);\n            if(q.size()>k)\n            {\n                q.pop();\n            }\n        }\n        return q.top();\n    }\n};\n```\n\n**upVote+= helpful? 1 : 0\nsuggestion is welcome !!!!**
['Heap (Priority Queue)', 'C++']