# LeetCode 215

def findKthLargest(self, nums: List[int], k: int) -> int:
def partitionK(nums:List[int], low, high, k:int) -> int:
pivot = nums[low]
left = low
right = high

while left < right:
while nums[right] <= pivot and left < right:
right -=1
if left < right:
nums[left] = nums[right]
left +=1

while nums[left] > pivot and left < right:
left +=1
if left < right:
nums[right] = nums[left]
right -=1

nums[left] =pivot
return left

l = 0
h = len(nums) -1
p = partitionK(nums, l, h, k)
while (p != k-1):
if p > k-1:
p = partitionK(nums, l, p-1, k)
else:
p = partitionK(nums, p+1, h, k)

return nums[k-1]

07-09 2188

09-12 139

05-27 3559

05-31 1484

02-23 2836

09-06 82

04-29 209

07-02 1006

05-29 1万+

02-03 152

08-08 1678

02-04 15

02-21 2078

01-23 53

06-10 313

01-04 126

04-14 59万+

03-13 15万+

02-19 18万+

03-04 14万+

03-06 1789

03-08 2万+

04-25 6万+

03-10 13万+

03-10 18万+

03-12 11万+

03-13 11万+

03-16 1510

03-18 1万+

03-19 8万+

03-19 3万+

03-20 9489

03-22 4601

03-23 4万+

03-24 3万+

03-25 3万+

05-08 5万+

03-25 9万+

03-27 5万+

03-29 21万+

03-29 10万+

03-30 16万+

05-31 6714

04-02 6096

04-02 4万+

05-31 149

04-06 1万+

04-06 7万+

04-06 2872

04-09 8万+

04-09 3万+

05-17 8929

04-11 4万+

04-15 6万+

04-18 4万+

04-20 4万+

04-24 3万+

05-03 1万+

05-16 5万+

05-06 1万+

05-06 2187

05-07 3831

05-08 4万+

05-10 3511

05-11 2581

05-14 6834

05-14 1183

05-16 3788

05-16 1万+

05-17 5260

05-30 974

05-18 2392

05-18 8694

05-18 3815

05-19 1万+

05-21 8196

05-21 8251

05-27 7334

05-30 711

#### 经典飞机大战如何编码实现？可以用 Python 写一个！

©️2019 CSDN 皮肤主题: 数字20 设计师: CSDN官方博客