随笔分类 -  dfs、bfs合集

47. Permutations II
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: Input: [1,1,2] Output: [ [1,1,2], [1,2, 阅读全文

posted @ 2020-09-19 16:52 wsw_seu 阅读(80) 评论(0) 推荐(0)

78. 子集
摘要:https://leetcode-cn.com/problems/subsets/submissions/ 给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 输入: nums = [1,2,3]输出:[ [3], [1], [2], 阅读全文

posted @ 2020-06-28 11:22 wsw_seu 阅读(178) 评论(0) 推荐(0)

127. 单词接龙
摘要:127. 单词接龙 https://leetcode-cn.com/problems/word-ladder/ func ladderLength(beginWord string, endWord string, wordList []string) int { i := 0 n := len(w 阅读全文

posted @ 2020-04-21 20:56 wsw_seu 阅读(172) 评论(0) 推荐(0)

200. 岛屿数量
摘要:200. 岛屿数量 https://leetcode-cn.com/problems/number-of-islands/ func numIslands(grid [][]byte) int { n := len(grid) if n == 0{ return 0 } //初始全部未访问过 fal 阅读全文

posted @ 2020-04-21 15:57 wsw_seu 阅读(137) 评论(0) 推荐(0)

导航