Kth Largest Element in an Array - Leetcode 215 - Heaps (Python)

Greg Hogg June 13, 2024
Video Thumbnail
Greg Hogg Logo

Greg Hogg

View Channel

About

Hey there - my name is Greg Hogg, a statistics alumni from the University of Waterloo in Ontario, Canada. I'm an ex-AI researcher who's published medical papers with Deepbreathe.ai, a startup that continues to win awards in the US military due to my and other's research. I still do AI contracts with companies like Nvidia, HP, and other big names today. I'm most known as a popular coding teacher online for interview skills like DSA and System Design, with over 150 million organic views and 650k+ followers in the space. My day job is running MLNOW Inc (which owns Algomap.io), where I help busy individuals get into the world's best software engineering roles at companies like FAANG. My company's website Algomap has over 75,000 users and a personalized live program tailored to cracking FAANG.

Video Description

Master Data Structures & Algorithms for FREE at https://AlgoMap.io/ Code solutions in Python, Java, C++ and JS for this can be found at my GitHub repo here: https://github.com/gahogg/Leetcode-Solutions/blob/main/ Complete DSA Pathway Zero to Hero: https://www.youtube.com/playlist?list=PLKYEe2WisBTFEr6laH5bR2J19j7sl5O8R Please check my playlists for free DSA problem solutions: https://www.youtube.com/playlist?list=PLKYEe2WisBTGq9T0wPulXz1otUsVeOGey https://www.youtube.com/playlist?list=PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg- https://www.youtube.com/playlist?list=PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ https://www.youtube.com/playlist?list=PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W https://www.youtube.com/playlist?list=PLKYEe2WisBTH7I9sCPjSZCs-iBAH4ybmS https://youtube.com/playlist?list=PLKYEe2WisBTH601scI_A008gm34oARlIp&si=DnCpq_RiFkObYn7p https://www.youtube.com/playlist?list=PLKYEe2WisBTF21RGRtZfGGolpHmca_d3N https://www.youtube.com/playlist?list=PLKYEe2WisBTH48RzVCL_LQrGW-ahPY44S https://www.youtube.com/playlist?list=PLKYEe2WisBTHcWHAGWvKJuVMu5ElMA18M https://www.youtube.com/playlist?list=PLKYEe2WisBTEY7eJBW7W-jbxlXCGb928P https://www.youtube.com/playlist?list=PLKYEe2WisBTHCmJ6IfEMjg8o--Bvfc5gt https://www.youtube.com/playlist?list=PLKYEe2WisBTFw-XWc-kwS3dkQeeSmvpg5 My Data Science & ML YouTube Playlist: https://youtube.com/playlist?list=PLKYEe2WisBTECZ8mZCfFxzrBBuGrS1Gfu&si=hspEoaBIyVLV_TyC Learn Python and Data Science FASTER at https://mlnow.ai :) Support the content: https://www.youtube.com/channel/UCJublDh2UsiIKsAE1553miw/join Follow me on Instagram: https://www.instagram.com/greghogg5/ Connect with me on LinkedIn: https://www.linkedin.com/in/greghogg/ Follow me on TikTok: https://www.tiktok.com/@greghogg5 Coursera Plus: https://imp.i384100.net/P0E3J6 My Favorite Courses: Data Structures & Algorithms: - UCalifornia San Diego DSA: https://imp.i384100.net/LP31oV - Stanford Algorithms: https://imp.i384100.net/vNBoxd - Python Data Structures: https://imp.i384100.net/NkZn47 - Meta Coding Interview Prep: https://imp.i384100.net/Y96rBJ Python: - UMichigan Python for Everybody: https://imp.i384100.net/QOLM73 - Python Mastery from MLNOW.ai: https://mlnow.ai/course-material/python/ - Google IT Automation w/ Python: https://imp.i384100.net/5g6Xyj Web Dev / Full Stack: - Meta Front-End Developer: https://imp.i384100.net/q4Jemy - IBM Full Stack Developer: https://imp.i384100.net/Gj9dMn - Meta Back-End Developer: https://imp.i384100.net/xkW0r5 - John Hopkins HTML, CSS & JS: https://imp.i384100.net/QyoRAA - IBM DevOps: https://imp.i384100.net/kjd2r0 Cloud Development: - AWS Fundamentals: https://imp.i384100.net/anqBjZ - GCP Cloud Engineer: https://imp.i384100.net/g1jvqB - Microsoft Azure Fundamentals: https://imp.i384100.net/EKm5O4 Game Development: - Michigan State Unity Development: https://imp.i384100.net/6eOBnr - UColorado C++ for Unreal Engine: https://www.coursera.org/specializations/cplusplusunrealgamedevelopment SQL & Data Science: - SQL by MLNOW.ai: https://mlnow.ai/course-material/sql/ - Python for Data Science by MLNOW.ai: https://mlnow.ai/course-material/datascience/ - Google Data Analytics: https://imp.i384100.net/1rkWAR - IBM Data Science: https://imp.i384100.net/P0ZRL6 - IBM Data Engineer: https://imp.i384100.net/4PbZyZ Machine Learning & AI: - ML Mastery at MLNOW.ai: https://mlnow.ai/course-material/ml/ - ML w/ Andrew Ng: https://www.coursera.org/specializations/machine-learning-introduction - Deep Learning w/ Andrew Ng: https://imp.i384100.net/a1kjJj

You May Also Like

Upgrade Your Galaxy Experience

AI-recommended products based on this video

Loading...
Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

(2,272)
$43.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
45W Super Fast Charger USBC Charger, 2Pack 10FT Samsung Charger Fast Charging Cord Cable& Samsung Type C Charger Block for Galaxy S25 S24 S23 S22 S21 Ultra/Plus, Tab S10 S9 S8 S7,iPad,Android Phone

45W Super Fast Charger USBC Charger, 2Pack 10FT Samsung Charger Fast Charging Cord Cable& Samsung Type C Charger Block for Galaxy S25 S24 S23 S22 S21 Ultra/Plus, Tab S10 S9 S8 S7,iPad,Android Phone

(52)
$22.79
FREE delivery Fri, Oct 3 on your first order
1K+ bought in past month
Loading...
Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

(2,272)
$43.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
Wireless Charger for Samsung Devices, Wireless Charging Station for Galaxy S25 Ultra/S25+/S25/S24 Ultra/Z Fold/Z Flip/S23/S22/S21, for Galaxy Watch7/Ultra/6/6 Classic/5 Pro/5/4, Galaxy Buds3 Pro

Wireless Charger for Samsung Devices, Wireless Charging Station for Galaxy S25 Ultra/S25+/S25/S24 Ultra/Z Fold/Z Flip/S23/S22/S21, for Galaxy Watch7/Ultra/6/6 Classic/5 Pro/5/4, Galaxy Buds3 Pro

(3,510)
$49.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

(2,272)
$43.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
45W Super Fast Charger USBC Charger, 2Pack 10FT Samsung Charger Fast Charging Cord Cable& Samsung Type C Charger Block for Galaxy S25 S24 S23 S22 S21 Ultra/Plus, Tab S10 S9 S8 S7,iPad,Android Phone

45W Super Fast Charger USBC Charger, 2Pack 10FT Samsung Charger Fast Charging Cord Cable& Samsung Type C Charger Block for Galaxy S25 S24 S23 S22 S21 Ultra/Plus, Tab S10 S9 S8 S7,iPad,Android Phone

(52)
$22.79
FREE delivery Fri, Oct 3 on your first order
1K+ bought in past month
Loading...
Galaxy S24 S25 USB C Charging Block 25W PD Super Fast Charger Type C Wall Plug Adapter Quick Charge for Samsung Galaxy S25/S24/S23/S22/S21/S20/Z Fold 3/4/5/Note20/iPhone 15/16/iPad/Tablet/Watch-1Pack

Galaxy S24 S25 USB C Charging Block 25W PD Super Fast Charger Type C Wall Plug Adapter Quick Charge for Samsung Galaxy S25/S24/S23/S22/S21/S20/Z Fold 3/4/5/Note20/iPhone 15/16/iPad/Tablet/Watch-1Pack

(7,777)
$12.99
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
LISEN USB C to USB C Cable 240W, [6.6ft 2Pack]Nylon Braided Type C Cable Fast Charge for iPhone 17 Pro Max USBC Fast Charging Cord for iPhone 17 16 Pro Air Samsung Macbook iPad Air 4/5 Xbox, Midnight
Best Seller

LISEN USB C to USB C Cable 240W, [6.6ft 2Pack]Nylon Braided Type C Cable Fast Charge for iPhone 17 Pro Max USBC Fast Charging Cord for iPhone 17 16 Pro Air Samsung Macbook iPad Air 4/5 Xbox, Midnight

(4,565)
$17.99
Prime
1K+ bought in past month
Loading...
Yarxiawin Phone Case for Samsung S25 Case with Ring Stand Magnetic Compatible with Magsafe Wireless Charger, Pink Bumper Cover Samsung Galaxy S25 Case Clear Shockproof (Blue)

Yarxiawin Phone Case for Samsung S25 Case with Ring Stand Magnetic Compatible with Magsafe Wireless Charger, Pink Bumper Cover Samsung Galaxy S25 Case Clear Shockproof (Blue)

(0)
$20.23
FREE delivery Sat, Jun 14 on your first order
Loading...
for Samsung Galaxy S25 Case, Galaxy S25/S24 Case with Tempered Glass, Compatible with MagSafe, Military Grade Drop Protection Anti-Scratch Clear Back Phone Cover Case for Samsung Galaxy S25/S24, Black

for Samsung Galaxy S25 Case, Galaxy S25/S24 Case with Tempered Glass, Compatible with MagSafe, Military Grade Drop Protection Anti-Scratch Clear Back Phone Cover Case for Samsung Galaxy S25/S24, Black

(2,272)
$10.99$10.44
FREE delivery Sat, Jun 14 on your first order
Loading...
DUEDUE for Samsung Galaxy S25 Plus Case Magnetic Samsung S24 Plus Case Clear Compatible with Magsafe Slim Cover with Stand Ring Shockproof Protective Case for Samsung S25 Plus/S24 Plus 6.7 Inch Clear

DUEDUE for Samsung Galaxy S25 Plus Case Magnetic Samsung S24 Plus Case Clear Compatible with Magsafe Slim Cover with Stand Ring Shockproof Protective Case for Samsung S25 Plus/S24 Plus 6.7 Inch Clear

(38)
$17.99
FREE delivery Sat, Jun 14 on your first order
Loading...
ivoler 3-in-1 Case for Samsung Galaxy S25 Ultra 5G 6.9" with 2 Pack Tempered Glass Screen Protector[Full Coverage], [Military Grade Protection] Slim Phone Bumper Cover Clear [Non-Yellowing]

ivoler 3-in-1 Case for Samsung Galaxy S25 Ultra 5G 6.9" with 2 Pack Tempered Glass Screen Protector[Full Coverage], [Military Grade Protection] Slim Phone Bumper Cover Clear [Non-Yellowing]

(3,499)
$13.99
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
GaoBao Magnetic for Samsung Galaxy S25 Case with Stand, [Built-in Invisible Kickstand] [Military Grade Shockproof] Slim Translucent Matte Protective Phone Cover for Samsung S25 6.2", Black

GaoBao Magnetic for Samsung Galaxy S25 Case with Stand, [Built-in Invisible Kickstand] [Military Grade Shockproof] Slim Translucent Matte Protective Phone Cover for Samsung S25 6.2", Black

(10)
$15.19
FREE delivery Sat, Jun 14 on your first order
Loading...
Telaso for Samsung Galaxy S25 Case, 360° Rotation Kickstand Ring Holder Plating Edge Soft Rubber TPU Bumper Slim Flexible Shockproof Protective Phone Case Cover for Samsung S25 2025,Sapphire Blue

Telaso for Samsung Galaxy S25 Case, 360° Rotation Kickstand Ring Holder Plating Edge Soft Rubber TPU Bumper Slim Flexible Shockproof Protective Phone Case Cover for Samsung S25 2025,Sapphire Blue

(122)
$14.99
FREE delivery Sun, Jun 15 on your first order
Loading...
DUEDUE Magnetic Case Compatible with Samsung Galaxy S25 Ultra Case,Clear S25 Ultra Phone Case MagSafe Ring Holder Stand Drop Shockproof Protective Phone Cover Cases for Samsung S25 Ultra 6.9 inch

DUEDUE Magnetic Case Compatible with Samsung Galaxy S25 Ultra Case,Clear S25 Ultra Phone Case MagSafe Ring Holder Stand Drop Shockproof Protective Phone Cover Cases for Samsung S25 Ultra 6.9 inch

(38)
$16.14
FREE delivery Sat, Jun 14 on your first order
50+ bought in past month
Loading...
Telaso for Samsung Galaxy S25 Case, 360° Rotation Kickstand Ring Holder Plating Edge Soft Rubber TPU Bumper Slim Flexible Shockproof Protective Phone Case Cover for Samsung S25 2025, Gray Green

Telaso for Samsung Galaxy S25 Case, 360° Rotation Kickstand Ring Holder Plating Edge Soft Rubber TPU Bumper Slim Flexible Shockproof Protective Phone Case Cover for Samsung S25 2025, Gray Green

(122)
$12.99
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
Vanjua for Samsung Galaxy S25 Case, Soft Silicone Full Camera Protecion Shockproof Phone Case Cover for Samsung Galaxy S25 Case (Mint Green)

Vanjua for Samsung Galaxy S25 Case, Soft Silicone Full Camera Protecion Shockproof Phone Case Cover for Samsung Galaxy S25 Case (Mint Green)

(24)
$9.99
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
YINLAI for Samsung Galaxy S25 Case Liquid Silicone with Ring Holder Stand Slim Soft Rubber Cover Shockproof Protective Phone Case for Samsung Galaxy S25 5G 6.2 Inch, Blue

YINLAI for Samsung Galaxy S25 Case Liquid Silicone with Ring Holder Stand Slim Soft Rubber Cover Shockproof Protective Phone Case for Samsung Galaxy S25 5G 6.2 Inch, Blue

(11)
$12.99
FREE delivery Sat, Jun 14 on your first order
Loading...
Vihibii for Samsung Galaxy S25+ Plus Case Wallet with Card Holder (4 Cards) [RFID Blocking] & Slide Camera Cover, Military Grade Drop Protection, Rugged Back & Silicone Edge Case, 6.7" 2025, Rose Gold

Vihibii for Samsung Galaxy S25+ Plus Case Wallet with Card Holder (4 Cards) [RFID Blocking] & Slide Camera Cover, Military Grade Drop Protection, Rugged Back & Silicone Edge Case, 6.7" 2025, Rose Gold

(174)
$27.99
FREE delivery Sat, Jun 14 on your first order
Loading...
Vihibii for Samsung Galaxy S25+ Plus Wallet Case with Card Holder (4 Cards) [RFID Blocking] & Slide Camera Cover, Military Grade Drop Protection, Hard Back & Silicone Edge Case, 6.7" 2025, Dark Purple

Vihibii for Samsung Galaxy S25+ Plus Wallet Case with Card Holder (4 Cards) [RFID Blocking] & Slide Camera Cover, Military Grade Drop Protection, Hard Back & Silicone Edge Case, 6.7" 2025, Dark Purple

(174)
$27.99
FREE delivery Sat, Jun 14 on your first order
Loading...
3 in 1 Charging Station for Samsung, Wireless Charger for Samsung S25/S25+/S24/S23/S22/Z Fold/Z Flip Series/Galaxy Watch/Buds Charging Dock Stand(Without Adapter)

3 in 1 Charging Station for Samsung, Wireless Charger for Samsung S25/S25+/S24/S23/S22/Z Fold/Z Flip Series/Galaxy Watch/Buds Charging Dock Stand(Without Adapter)

(3)
$36.99
PrimeFREE delivery Sat, Jun 14
Loading...
Wireless Charger for Samsung Charging Station with Clock for Samsung Galaxy S25 Ultra/S24 Ultra/Z Flip 6/Fold 5/Bud, 3 in 1 Charger Station Watch Charger for Samsung Galaxy Watch 7/6/5Pro(Wood Grain)

Wireless Charger for Samsung Charging Station with Clock for Samsung Galaxy S25 Ultra/S24 Ultra/Z Flip 6/Fold 5/Bud, 3 in 1 Charger Station Watch Charger for Samsung Galaxy Watch 7/6/5Pro(Wood Grain)

(1,430)
$49.99$39.96
PrimeFREE delivery Sun, Jun 15
Loading...
Wireless Charger for Samsung Charging Station, 3 in 1 Android Phone Wireless Charger for Samsung Galaxy S25 Ultra/S24 Ultra/S23/Z Flip 6/Fold 6/Buds, Charger for Galaxy Watch Ultra/7/6/5/4/3 (Black)

Wireless Charger for Samsung Charging Station, 3 in 1 Android Phone Wireless Charger for Samsung Galaxy S25 Ultra/S24 Ultra/S23/Z Flip 6/Fold 6/Buds, Charger for Galaxy Watch Ultra/7/6/5/4/3 (Black)

(7,328)
$42.99
PrimeFREE delivery Sat, Jun 14
50+ bought in past month
Loading...
Wireless Charger for Samsung Devices, Wireless Charging Station for Galaxy S25 Ultra/S25+/S25/S24 Ultra/Z Fold/Z Flip/S23/S22/S21, for Galaxy Watch7/Ultra/6/6 Classic/5 Pro/5/4, Galaxy Buds3 Pro

Wireless Charger for Samsung Devices, Wireless Charging Station for Galaxy S25 Ultra/S25+/S25/S24 Ultra/Z Fold/Z Flip/S23/S22/S21, for Galaxy Watch7/Ultra/6/6 Classic/5 Pro/5/4, Galaxy Buds3 Pro

(3,510)
$49.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month