![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
理解大神的解题思路,描述自己的解题想法,编码大进步
赛文不打奥特曼
这个作者很懒,什么都没留下…
展开
-
Leetcode #2006
差的绝对值为 K 的数对数目 简单题 题解 class Solution: def countKDifference(self, nums: List[int], k: int) -> int: count = collections.Counter(nums) ans,collet = 0,[] for value in count: collet.append(value) data_length =原创 2022-02-09 16:25:42 · 6115 阅读 · 0 评论 -
Leetcode-1078 Bigram 分词
题目 解答 这道题唯一需要考虑的就是越界问题。 class Solution: def findOcurrences(self, text: str, first: str, second: str) -> List[str]: spitText = text.split() ans = [] for i in range (0,len(spitText)-2): if (spitText[i] == first and原创 2021-12-26 15:26:10 · 242 阅读 · 0 评论 -
Leetcode - 1518
1518-换酒问题 一道简单的问题,面试时曾遇到过这道问题,答完之后解答时被告知还能向店家借一瓶,当时的想法是,这一瓶,我没亏,那谁亏了呢! 题目如下: 解题思路 在这里插入代码片原创 2021-12-22 14:21:24 · 195 阅读 · 0 评论