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 | 455 Views, 33591 Search Bots | 66 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 455 Views, 33591 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 | 455 Views, 33591 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
- Daily Interview Problem: Merge Overlapping Intervals
- Algorithm Interview: Subarray With Target Sum
- Consecutive Ones
- Daily Interview Problem: Buddy Strings
- Daily Interview Problem: Word Ordering in a Different Alphabetical Order
- Algorithm Interview: Permutations of numbers
- [Daily Problem] Longest Palindromic Substring
- Find Pythagorean Triplets
- Spreadsheet Column Title
- Daily Interview Question: Find Cycles in a Graph
©2006~2024 SteakOverCooked - 0.01286 Seconds(s) - 1523.714 KB/s - 38 Online Memory: 494.13 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="index, 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 !