LeetCode130——被圍繞的區域

我的LeetCode代碼倉:https://github.com/617076674/LeetCode 原題鏈接:https://leetcode-cn.com/problems/surrounded-regions/description/ 題目描述: 知識點:深度優先遍歷 思路:對邊界上的'O'進行深度優先遍歷標記遍歷到的'O',將未遍歷到的'O'填充爲'X' 時間複雜度和空間複雜度均是O(n
相關文章
相關標籤/搜索