风一更--leetcode总结--优秀题解

target: 记录优秀题解


 

1. 图论. dfs 深度优先搜索

  1. 从树的dfs 关联到图的 dfs. 优秀讲解. : https://leetcode.cn/problems/number-of-islands/solutions/211211/dao-yu-lei-wen-ti-de-tong-yong-jie-fa-dfs-bian-li-/?envType=study-plan-v2&envId=top-interview-150
  2.  

2.前缀和. 处理子数组和子串问题.

   https://leetcode.cn/problems/subarray-sum-equals-k/solutions/562174/de-liao-yi-wen-jiang-qian-zhui-he-an-pai-yhyf/?envType=study-plan-v2&envId=top-100-liked

3.双指针,滑动窗口 负雪明烛题解.

   m_1004_max_consective ones III

  https://leetcode.cn/problems/max-consecutive-ones-iii/solutions/609055/fen-xiang-hua-dong-chuang-kou-mo-ban-mia-f76z/?envType=study-plan-v2&envId=leetcode-75

4.two pointers 趋近 16. 3sums closest

https://leetcode.cn/problems/3sum-closest/solutions/6959/hua-jie-suan-fa-16-zui-jie-jin-de-san-shu-zhi-he-b/

5. combination sum ii  leetcode 40;

https://leetcode.cn/problems/combination-sum-ii/solutions/14753/hui-su-suan-fa-jian-zhi-python-dai-ma-java-dai-m-3/ 

6.permutation. leetcode 47

https://leetcode.cn/problems/permutations-ii/solutions/9917/hui-su-suan-fa-python-dai-ma-java-dai-ma-by-liwe-2/

7. preSum + Map,  leetcode 525 

https://leetcode.cn/problems/contiguous-array/solutions/809920/gong-shui-san-xie-qian-zhui-he-ha-xi-bia-q400/

8. preSum split,   left 0 count, right 1 counter, 前缀和来统计 分割点左边 1的个数,右边0的个数.

https://leetcode.cn/problems/flip-string-to-monotone-increasing/solutions/1593843/by-ac_oier-h0we/

 

posted @ 2024-02-18 20:08  君子之行  阅读(7)  评论(0编辑  收藏  举报