- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Heap-16 | 1337. The K Weakest Rows in a Matrix | 🔥 Beginner, Medium & Advanced Level
JOIN MY WHATSAPP COMMUNITY FOR UPDATES: https://chat.whatsapp.com/BTlYJt2pCxj1m3H4aJZOGX
Support me 🙌🏻: https://www.buymeacoffee.com/anuj.baranwal.1994
Leetcode: https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/description/
Github Repo: https://github.com/team-codebug/leetcode
Notes: https://github.com/team-codebug/leetcode/blob/main/DSA_In_90Days/10_Heap/Heap_16_1337.%20The%20K%20Weakest%20Rows%20in%20a%20Matrix.svg
3 Months DSA for Placements! 🚀 Beginner to Advanced Playlist
🧠 Leetcode 1337 - The K Weakest Rows in a Matrix
In this video, we’ll solve a classic matrix + heap problem asked in interviews: "Find the k weakest rows in a matrix".
We’ll walk through 3 different approaches step-by-step:
✅ Approach 1: Sorting
Count soldiers in each row and sort based on strength.
✅ Approach 2: Binary Search
Use binary search to efficiently count soldiers (1s) in each row.
✅ Approach 3: Max Heap
Maintain a max-heap of size K to track the weakest rows while optimizing time and space.
You’ll learn:
How to model this as a counting + sorting problem
Efficiently reduce time complexity using binary search
Why a max-heap helps in limiting extra space while tracking K weakest rows
Coding and optimizing each approach in real-time
📌 Problem Link: https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/
📚 Part of our DSA playlist on Heaps, Binary Search & Matrices
#DSA #Leetcode1337 #Heaps #BinarySearch #Sorting #CodingInterview #JavaDSA #TopK #MatrixProblems #MaxHeap #LeetcodeSolutions #CodingWithCTOBhaiya #DataStructures #Algorithms
===========================
➡️ Connect with me:
LinkedIn : https://www.linkedin.com/in/anuj-kumar-9a188968/
Instagram : https://www.instagram.com/mr.anuj.brandy/
Discord : https://discord.com/invite/bbJXxFcauK
===========================
Видео Heap-16 | 1337. The K Weakest Rows in a Matrix | 🔥 Beginner, Medium & Advanced Level канала CTO Bhaiya
Support me 🙌🏻: https://www.buymeacoffee.com/anuj.baranwal.1994
Leetcode: https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/description/
Github Repo: https://github.com/team-codebug/leetcode
Notes: https://github.com/team-codebug/leetcode/blob/main/DSA_In_90Days/10_Heap/Heap_16_1337.%20The%20K%20Weakest%20Rows%20in%20a%20Matrix.svg
3 Months DSA for Placements! 🚀 Beginner to Advanced Playlist
🧠 Leetcode 1337 - The K Weakest Rows in a Matrix
In this video, we’ll solve a classic matrix + heap problem asked in interviews: "Find the k weakest rows in a matrix".
We’ll walk through 3 different approaches step-by-step:
✅ Approach 1: Sorting
Count soldiers in each row and sort based on strength.
✅ Approach 2: Binary Search
Use binary search to efficiently count soldiers (1s) in each row.
✅ Approach 3: Max Heap
Maintain a max-heap of size K to track the weakest rows while optimizing time and space.
You’ll learn:
How to model this as a counting + sorting problem
Efficiently reduce time complexity using binary search
Why a max-heap helps in limiting extra space while tracking K weakest rows
Coding and optimizing each approach in real-time
📌 Problem Link: https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/
📚 Part of our DSA playlist on Heaps, Binary Search & Matrices
#DSA #Leetcode1337 #Heaps #BinarySearch #Sorting #CodingInterview #JavaDSA #TopK #MatrixProblems #MaxHeap #LeetcodeSolutions #CodingWithCTOBhaiya #DataStructures #Algorithms
===========================
➡️ Connect with me:
LinkedIn : https://www.linkedin.com/in/anuj-kumar-9a188968/
Instagram : https://www.instagram.com/mr.anuj.brandy/
Discord : https://discord.com/invite/bbJXxFcauK
===========================
Видео Heap-16 | 1337. The K Weakest Rows in a Matrix | 🔥 Beginner, Medium & Advanced Level канала CTO Bhaiya
Комментарии отсутствуют
Информация о видео
11 мая 2025 г. 10:21:06
00:35:39
Другие видео канала




















