当前位置:网站首页>The kth largest element in the array
The kth largest element in the array
2022-07-04 19:21:00 【charlsdm】
- The... In the array K The biggest element
Given an array of integers nums And integer k, Please return the... In the array k The biggest element .
Please note that , What you need to look for is the number after array sorting k The biggest element , Not the first. k A different element .
Example 1:
Input : [3,2,1,5,6,4] and k = 2
Output : 5
Example 2:
Input : [3,2,3,1,2,4,5,5,6] and k = 4
Output : 4
my C#AC Code ` public partial class Solution
{
public int FindKthLargest(int[] nums, int k)
{
List<int> mynums = nums.ToList();
mynums.Sort();
mynums.Reverse();
return mynums[k-1];
}
}
边栏推荐
- Caché JSON 使用JSON适配器
- 英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
- 爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
- 2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import 'fmt' func
- Process of manually encrypt the mass-producing firmware and programming ESP devices
- PB的扩展DLL开发(超级篇)(七)
- 李迟2022年6月工作生活总结
- prometheus安装
- 使用FTP
- LeetCode 赎金信 C#解答
猜你喜欢

2022 ByteDance daily practice experience (Tiktok)

How to modify icons in VBS or VBE

ByteDance dev better technology salon was successfully held, and we joined hands with Huatai to share our experience in improving the efficiency of web research and development

Wireshark网络抓包

Angry bird design based on unity

Scala基础教程--15--递归

神经网络物联网平台搭建(物联网平台搭建实战教程)

A method of using tree LSTM reinforcement learning for connection sequence selection

Scala basic tutorial -- 15 -- recursion

2022CoCa: Contrastive Captioners are Image-Text Fountion Models
随机推荐
Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join
876. Intermediate node of linked list
[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0
信息学奥赛一本通 1336:【例3-1】找树根和孩子
repeat_P1002 [NOIP2002 普及组] 过河卒_dp
Go microservice (II) - detailed introduction to protobuf
Basic tutorial of scala -- 16 -- generics
Cache é JSON uses JSON adapters
Scala基础教程--15--递归
李迟2022年6月工作生活总结
Scala basic tutorial -- 17 -- Collection
[release] a tool for testing WebService and database connection - dbtest v1.0
Guys, for help, I use MySQL CDC 2.2.1 (Flink 1.14.5) to write Kafka and set
Scala basic tutorial -- 15 -- recursion
One question per day (2022-07-02) - Minimum refueling times
Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
神经网络物联网应用技术就业前景【欢迎补充】
TorchDrug教程
英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
[opencv introduction to mastery 9] opencv video capture, image and video conversion