mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-04-23 22:09:37 +00:00
8 lines
204 B
C
8 lines
204 B
C
int *cmpval(const void *a, const void *b) { return *(int *)b - *(int *)a; }
|
|
|
|
int findKthLargest(int *nums, int numsSize, int k)
|
|
{
|
|
qsort(nums, numsSize, sizeof(int), cmpval);
|
|
return nums[k - 1];
|
|
}
|