摘要: 题目描述 leetcode - 1:https://leetcode-cn.com/problems/two-sum/ 解题关键 hashmap的使用 碎碎念 题目比较简单,暴力过很容易,不过借助hash可以降低时间复杂度,但是增加了空间的消耗。学习了hashmap的使用 key:value 定义 阅读全文
posted @ 2020-05-31 23:22 _Sleeping 阅读(103) 评论(0) 推荐(0)
摘要: 题目描述 leetcode - 5:https://leetcode-cn.com/problems/longest-palindromic-substring/submissions/ 解题关键 动态规划 中心扩散(比较好理解) 代码 1、暴力(会超时) 时间复杂度O(N^3),N 是字符串的长度 阅读全文
posted @ 2020-05-31 01:11 _Sleeping 阅读(294) 评论(0) 推荐(0)