摘要: 思路: 来自https://leetcode-cn.com/problems/palindrome-linked-list/solution/zhong-dian-fan-zhuan-dui-bi-by-powcai/ 例: 1->2->3->2->1 1.先用双指针找到中点上界。 即:找到第四个节 阅读全文
posted @ 2020-04-17 18:00 ChevisZhang 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 想法: 本题作为9024数据结构与算法的一道经典题,计算质数,用的方法''厄拉多塞筛法''需要经常温习 代码: class Solution: def countPrimes(self, n: int) -> int: if n<=2: return 0 dp = [1 for _ in range 阅读全文
posted @ 2020-04-17 10:43 ChevisZhang 阅读(123) 评论(0) 推荐(0) 编辑