![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode题解
文章平均质量分 92
tribe-795
这个作者很懒,什么都没留下…
展开
-
LeetCode:动态规划+贪心题目整理
以下均为AC代码,后续将不断更新…… 1.字符串分割:(LeetCode:word-break) Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more di...原创 2018-10-24 16:26:06 · 2365 阅读 · 0 评论 -
LeetCode 字符串滑动窗口问题汇总:
对于字符串窗口的问题,使用hashmap来统计出现的字符及次数,然后通过构建窗口来统计, 1.最小子字符串(LeetCode: minimum-window-substring) Given a string S and a string T, find the minimum window in S which will contain all the chara...原创 2018-10-24 15:28:14 · 1571 阅读 · 0 评论 -
LeetCode 回文问题汇总:
如果要求输出所有可能的解,使用深度优先搜索。如果要找出最优的解,或者解的数量,往往可以使用动态规划。 关于回文问题的解决方案汇总如下,所有代码均已AC。 1.判断回文链表:(leetcode : Palindrome Linked List) Given a singly linked list, determine if it is a palindrome. ...原创 2018-10-24 11:48:01 · 344 阅读 · 0 评论 -
LeetCode 数组排列组合问题汇总:
字符的排列组合问题,使用递归+回溯方法。对于有重复元素或者需要组合的元素具有一定顺序,需要先进行排序。 排列问题因为对所有元素进行排列,判断是否为结果的条件是list的大小和数组的长度相同,否则,依次将没有排列的元素添加到list中,结束一次排列后需要回溯;对于数组元素唯一,只需要在循环中判断list中是否包含该元素,不包含,进行添加,否则,跳过。对于数组元素不唯一...原创 2018-10-24 11:26:29 · 1664 阅读 · 0 评论 -
LeetCode合并问题汇总
刷题包括笔试中经常会遇到合并问题,将LeetCode中常见的合并问题的代码总结如下,包括数组合并、链表合并、区间合并,涉及到排序,递归等常用操作: 1.关于数组合并:(LeetCode 88:merge-sorted-array) Given two sorted integer arrays A and B, merge B into A as one so...原创 2018-10-24 10:40:05 · 222 阅读 · 0 评论