Skip to content

Commit

Permalink
Create 1985-Find-The-Kth-Largest-Integer-In-The-Array.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankush11903 authored Jan 8, 2023
1 parent f594ed8 commit 036ea5a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cpp/1985-Find-The-Kth-Largest-Integer-In-The-Array.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {
private:
static bool st(string &a,string &b){
if(a.size()==b.size()) return a<b;
return a.size()<b.size();
}


public:
string kthLargestNumber(vector<string>& nums, int k) {
sort(nums.begin(),nums.end(),st);
return nums[nums.size()-k];

}
};

0 comments on commit 036ea5a

Please sign in to comment.