У нас вы можете посмотреть бесплатно Surrounded Regions | Leetcode или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
This video explains a very important programming interview problem which is to mark all surrounded regions of zeroes with all X.A group of zero is called a region when the group doesn't have any boundary zero.If a group of zeroes have one or more boundary zero then they will not form a valid region and hence remain unchanged in the result.I have shown 2 approaches for this problem.The first approach is by using 2 DFS calls.Call once to verify if the region is valid and if it is valid then call the second DFS call to convert all 0s to X.The second method is an efficient approach which makes use of DFS to mark all non-region zeroes to 1s and then iterate over the entire matrix to convert all remaining 0s to X and all 1s to 0s again and skip all X.At the end of the video, i have explained the code-walk through for both the depth first search traversal methods.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :) ================================================================= INSTAGRAM: / surya.pratap.k LinkedIn: / surya-pratap-kahar-47bb01168 ================================================================= CODE LINK: https://gist.github.com/SuryaPratapK/... DFS: • Depth first search | DFS | Depth first tra... BFS: • Breadth first search | BFS | Breadth first... Number of islands: • Number of islands | Leetcode #200