mirror of
https://github.com/TheAlgorithms/C
synced 2025-04-22 13:16:14 +03:00
9 lines
206 B
C
9 lines
206 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];
|
|
}
|