2020年4月21日

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 阅读(167) 评论(0) 推荐(0) 编辑

1. 线性DP 887. 鸡蛋掉落 (DP+二分)

摘要: 887. 鸡蛋掉落 (DP+二分) https://leetcode-cn.com/problems/super-egg-drop/ /*首先分析1个蛋,1个蛋的话,最坏情况需要N次,每次只能从0 1 2 。。。开始如果蛋的个数随便用,或者说2的k次方大于等于N楼层高度,则可以利用二分。如果蛋的个数 阅读全文

posted @ 2020-04-21 18:01 wsw_seu 阅读(232) 评论(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 阅读(131) 评论(0) 推荐(0) 编辑

导航