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 | 462 Views, 34158 Search Bots | 66 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 462 Views, 34158 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 | 462 Views, 34158 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
- Kaprekar
- Daily Interview Problem: Count Number of Unival Subtrees
- Floor and Ceiling of a Binary Search Tree
- Algorithm Interview: Determine If Linked List is Palindrome
- Two Tricks of Delphi
- Daily Interview Problem: Contiguous Subarray with Maximum Sum
- Number of Ways to Climb Stairs
- Daily Interview Problem: Deepest Node in a Binary Tree
- Daily Interview Problem: Largest BST in a Binary Tree
- Find the non-duplicate number
©2006~2024 SteakOverCooked - 0.008 Seconds(s) - 2393.323 KB/s - 35 Online Memory: 491.52 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 !