File: root - text - article - 2019 - 11 - find-the-k-th-largest-element-in-a-list.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 447 Views, 32260 Search Bots | 66 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 447 Views, 32260 Search Bots | 66 Words
| Browse | Archive
Hi, here's your problem today. This problem was recently asked by Facebook:
By the way, check out our NEW project AlgoPro (http://algopro.com) for over 60+ video coding sessions with ex-Google/ex-Facebook engineers.
Given a list, find the k-th largest element in the list.
Input: list = [3, 5, 2, 4, 6, 8], k = 3
Output: 5
Here is a starting point:
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 447 Views, 32260 Search Bots | 66 Words By the way, check out our NEW project AlgoPro (http://algopro.com) for over 60+ video coding sessions with ex-Google/ex-Facebook engineers.
Given a list, find the k-th largest element in the list.
Input: list = [3, 5, 2, 4, 6, 8], k = 3
Output: 5
Here is a starting point:
def findKthLargest(nums, k):
# Fill this in.
print findKthLargest([3, 5, 2, 4, 6, 8], 3)
# 5
Related Articles
- Two-Sum
- 56 Bytes
- Daily Interview Problem: Largest Product of 3 Elements I
- Spreadsheet Columns
- Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
- Algorithm Interview: Permutations of numbers
- [Daily Problem] Longest Increasing Subsequence
- Algorithm Interview Question: Nth Fibonacci Number
- Daily Interview Problem: Full Binary Tree
- Daily Interview Problem: Longest Substring With K Distinct Characters
©2006~2024 SteakOverCooked - 0.00787 Seconds(s) - 2475.951 KB/s - 30 Online Memory: 492.34 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !