Skip to content

Commit 343e195

Browse files
authored
Merge pull request neetcode-gh#1960 from Ankush11903/1985
Create 1985-Find-The-Kth-Largest-Integer-In-The-Array.cpp
2 parents fa2d4c3 + 036ea5a commit 343e195

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
private:
3+
static bool st(string &a,string &b){
4+
if(a.size()==b.size()) return a<b;
5+
return a.size()<b.size();
6+
}
7+
8+
9+
public:
10+
string kthLargestNumber(vector<string>& nums, int k) {
11+
sort(nums.begin(),nums.end(),st);
12+
return nums[nums.size()-k];
13+
14+
}
15+
};

0 commit comments

Comments
 (0)