C++ MinHeap Solution
Runtime: 212 ms, faster than 76.47% of C++ online submissions for Find the Kth Largest Integer in the Array.\nMemory Usage: 69.6 MB, less than 17.65% of C++ onl
Runtime: 212 ms, faster than 76.47% of C++ online submissions for Find the Kth Largest Integer in the Array.\nMemory Usage: 69.6 MB, less than 17.65% of C++ online submissions for Find the Kth Largest Integer in the Array.\n\n\nProblem is similar to [215. Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/). \n\nHere numbers are given in string format and so we have to use a custom comparator in MinHeap. Add \nnumbers in the MinHeap and if MinHeap size > k then we pop number from it. At last we find the Kth \nlargest number at the top.\n\n\n```\nclass Solution {\npublic:\n    \n    struct comp\n    {\n        bool operator()(const string &a, const string &b)\n        {\n            return a.length()==b.length() ? (a>b) : a.length()>b.length();\n        }    \n    };\n    \n    string kthLargestNumber(vector<string>& nums, int k) {\n        \n        priority_queue<string,vector<string>,comp>pQ;\n        \n        for(auto &t : nums)\n        {\n            pQ.push(t);\n            \n            if(pQ.size()>k)pQ.pop();\n        }\n        \n        return pQ.top();\n    }\n};\n```\n\n\n\n
['C', 'Heap (Priority Queue)']