Max Consecutive Ones III - Leetcode 1004 - Sliding Window (Python)

Greg Hogg April 17, 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

Coding Mastery Essentials

AI-recommended products based on this video

Loading...
Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

(382)
$94.95
PrimeFREE delivery Sat, Jun 14
Loading...
Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

(382)
$94.95
PrimeFREE delivery Sat, Jun 14
Loading...
10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

(1)
$99.99
FREE delivery Mon, Aug 11
Loading...
ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

(49)
$117.29$102.21
$6.86 delivery Thu, Aug 14
Loading...
7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

(61)
$68.99
FREE delivery Tue, Aug 12
Loading...
BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

(288)
$54.14
FREE delivery Sun, Jun 22
Loading...
Logitech K400 Plus Wireless Touch TV Keyboard With Easy Media Control and Built-in Touchpad, HTPC Keyboard for PC-connected TV, Windows, Android, Chrome OS, Laptop, Tablet - Black
Best Seller

Logitech K400 Plus Wireless Touch TV Keyboard With Easy Media Control and Built-in Touchpad, HTPC Keyboard for PC-connected TV, Windows, Android, Chrome OS, Laptop, Tablet - Black

(38,516)
$39.98$35.98
FREE delivery Thu, Sep 4
500+ bought in past month
Loading...
Dell 24 Monitor - SE2425HM - 23.8-inch Full HD (1920x1080) 16:9 100Hz Display, IPS Panel, 16.70 Million Colors, Anti-Glare, 1 HDMI / 1 VGA Port, TÜV Rheinland 3-Star*, Comfortview Plus - Black

Dell 24 Monitor - SE2425HM - 23.8-inch Full HD (1920x1080) 16:9 100Hz Display, IPS Panel, 16.70 Million Colors, Anti-Glare, 1 HDMI / 1 VGA Port, TÜV Rheinland 3-Star*, Comfortview Plus - Black

(169)
$119.99$103.99
FREE delivery Tue, Oct 7
300+ bought in past month
Loading...
Dell S2425HS Monitor - 23.8 Inch, FHD (1920x1080) Display, 100Hz Refresh Rate 1500:1 Contrast Ratio, TÜV Rheinland Eye Comfort 4 Star, Integrated 2x5W Speaker, Height/Tilt/Swivel/Pivot - Ash White

Dell S2425HS Monitor - 23.8 Inch, FHD (1920x1080) Display, 100Hz Refresh Rate 1500:1 Contrast Ratio, TÜV Rheinland Eye Comfort 4 Star, Integrated 2x5W Speaker, Height/Tilt/Swivel/Pivot - Ash White

(15)
$139.99
FREE delivery Tue, Oct 7
300+ bought in past month
Loading...
USB C Docking Station Dual Monitor for Dell Hp,15-in-1 Laptop Docking Station 3 Monitors USB C Hub with Dual 4K HDMI,8K DP,Button,PD Charging,Ethernet,6 USB A&C,SD/TF, Audio USB-C Multiport Adapter

USB C Docking Station Dual Monitor for Dell Hp,15-in-1 Laptop Docking Station 3 Monitors USB C Hub with Dual 4K HDMI,8K DP,Button,PD Charging,Ethernet,6 USB A&C,SD/TF, Audio USB-C Multiport Adapter

(1,359)
$67.98
FREE delivery Sun, Aug 24
100+ bought in past month
Loading...
Dell 24 Monitor - P2425H EPEAT

Dell 24 Monitor - P2425H EPEAT

(57)
$239.99$189.05
FREE delivery Tue, Oct 7
50+ bought in past month
Loading...
TP-Link AC1300 USB WiFi Adapter (Archer T3U) - 2.4G/5G Dual Band Wireless Network Adapter for PC Desktop, MU-MIMO WiFi Dongle, USB 3.0, Supports Windows 11/10/8.1/8/7/XP, Mac OS 10.9-10.14

TP-Link AC1300 USB WiFi Adapter (Archer T3U) - 2.4G/5G Dual Band Wireless Network Adapter for PC Desktop, MU-MIMO WiFi Dongle, USB 3.0, Supports Windows 11/10/8.1/8/7/XP, Mac OS 10.9-10.14

(19,238)
$19.99$15.96
FREE delivery Sun, Jun 22 on your first order
500+ bought in past month
Loading...
TP-Link AC1300 High Gain WiFi USB Adapter (Archer T4U)- Dual Band Wireless Network Adapter for Desktop with 2.4GHz/5GHz High Gain Antennas, MU-MIMO, Support Windows 10/8.1/8/7/XP, Mac OS

TP-Link AC1300 High Gain WiFi USB Adapter (Archer T4U)- Dual Band Wireless Network Adapter for Desktop with 2.4GHz/5GHz High Gain Antennas, MU-MIMO, Support Windows 10/8.1/8/7/XP, Mac OS

(47,080)
$24.99$21.17
FREE delivery Sun, Jun 22 on your first order
100+ bought in past month
Loading...
OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R660XS R760XS

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R660XS R760XS

(0)
$1,474.98
FREE delivery Aug 14 - 22
Loading...
OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge XE9680

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge XE9680

(0)
$1,474.98
FREE delivery Aug 14 - 22
Loading...
OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R6625 R760 R7615 R7625

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R6625 R760 R7615 R7625

(0)
$1,474.98
FREE delivery Aug 14 - 22
Loading...
OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge HS5610 HS5620

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge HS5610 HS5620

(0)
$1,474.98
FREE delivery Aug 14 - 22
Loading...
Corsair RM1000e Fully Modular Low-Noise ATX Power Supply - Dual EPS12V Connectors - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Modern Standby Support - Black

Corsair RM1000e Fully Modular Low-Noise ATX Power Supply - Dual EPS12V Connectors - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Modern Standby Support - Black

(41)
$219.19$204.66
FREE delivery Oct 15 - 22
Loading...
Corsair RM1200x Shift Fully Modular ATX Power Supply - Modular Side Interface - ATX 3.1 & PCIe 5.1 Compliant - Zero RPM Fan Mode - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Black, 1200W

Corsair RM1200x Shift Fully Modular ATX Power Supply - Modular Side Interface - ATX 3.1 & PCIe 5.1 Compliant - Zero RPM Fan Mode - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Black, 1200W

(25)
$254.98$203.98
FREE delivery Wed, Oct 8
50+ bought in past month
Loading...
Corsair RM1200e (2023) Fully Modular Low-Noise ATX Power Supply with 12V-2x6 Cable – ATX 3.1 & PCIe 5.1 Compliant, Cybenetics Platinum Efficiency, 105°C-Rated Capacitors, Modern Standby Mode – Black

Corsair RM1200e (2023) Fully Modular Low-Noise ATX Power Supply with 12V-2x6 Cable – ATX 3.1 & PCIe 5.1 Compliant, Cybenetics Platinum Efficiency, 105°C-Rated Capacitors, Modern Standby Mode – Black

(49)
$249.99
FREE delivery Wed, Oct 8
Loading...
Corsair HX1200i (2025) Fully Modular Ultra-Low Noise ATX Power Supply with 12V-2x6 Cable – ATX 3.1 & PCIe 5.1 Compliant, Cybenetics Platinum Efficiency, Fluid Dynamic Bearing Fan – Black

Corsair HX1200i (2025) Fully Modular Ultra-Low Noise ATX Power Supply with 12V-2x6 Cable – ATX 3.1 & PCIe 5.1 Compliant, Cybenetics Platinum Efficiency, Fluid Dynamic Bearing Fan – Black

(69)
$379.99
FREE delivery Oct 17 - Nov 15
Loading...
SAMSUNG 870 EVO SATA SSD 500GB 2.5” Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E500B/AM [Canada Version]

SAMSUNG 870 EVO SATA SSD 500GB 2.5” Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E500B/AM [Canada Version]

(41,678)
$74.97
FREE delivery Wed, Jun 18
400+ bought in past month
Loading...
SAMSUNG 870 EVO SATA III SSD 4TB 2.5” Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E4T0B/AM [Canada Version]

SAMSUNG 870 EVO SATA III SSD 4TB 2.5” Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E4T0B/AM [Canada Version]

(41,656)
$399.97
FREE delivery Tue, Jun 17
100+ bought in past month
Loading...
Samsung 990 EVO Plus - 4TB PCIe Gen4. X4, Gen5. X2 NVMe 2.0 - M.2 Internal SSD, Speed Up to 7,250 MBs, Upgrade Storage for PC-Laptops, HMB Technology and Intelligent Turbowrite (MZ-V9S4T0B/AM)

Samsung 990 EVO Plus - 4TB PCIe Gen4. X4, Gen5. X2 NVMe 2.0 - M.2 Internal SSD, Speed Up to 7,250 MBs, Upgrade Storage for PC-Laptops, HMB Technology and Intelligent Turbowrite (MZ-V9S4T0B/AM)

(1,811)
$359.99$341.99
FREE delivery Tue, Jun 17
100+ bought in past month
Loading...
SAMSUNG EVO Select Micro SD-Memory-Card + Adapter, 128GB microSDXC 160MB/s Full HD & 4K UHD, UHS-I, U3, A2, V30, for Android Smartphones, Tablets, Nintendo-Switch (MB-ME128SA/AM) [Canada Version]

SAMSUNG EVO Select Micro SD-Memory-Card + Adapter, 128GB microSDXC 160MB/s Full HD & 4K UHD, UHS-I, U3, A2, V30, for Android Smartphones, Tablets, Nintendo-Switch (MB-ME128SA/AM) [Canada Version]

(12,472)
$19.99$18.59
FREE delivery Sun, Aug 10 on your first order
400+ bought in past month
Loading...
Western Digital 2TB WD Blue SA510 SATA Internal Solid State Drive SSD - SATA III 6 Gb/s, 2.5"/7mm, Up to 560 MB/s - WDS200T3B0A

Western Digital 2TB WD Blue SA510 SATA Internal Solid State Drive SSD - SATA III 6 Gb/s, 2.5"/7mm, Up to 560 MB/s - WDS200T3B0A

(74,910)
$169.97
FREE delivery Tue, Jun 17
50+ bought in past month