Skip to content

Latest commit

 

History

History
13 lines (13 loc) · 237 Bytes

GatesMa.md

File metadata and controls

13 lines (13 loc) · 237 Bytes

c++

class Solution {
public:
    static bool cmp(int a, int b) {
        return a > b;
    }
    int findKthLargest(vector<int>& nums, int k) {
        sort(nums.begin(), nums.end(), cmp);
        return nums[k-1];
    }
};