Leetcode
biglee要好好写博客
这个作者很懒,什么都没留下…
展开
-
Python解法:680. Valid Palindrome II
class Solution(object): def validPalindrome(self, s): l = len(s) if l == 2: return True i = 0 j = l - 1 count = 0 while(i<j): ...原创 2018-07-31 17:21:24 · 390 阅读 · 0 评论 -
Python:347. 前K个高频元素( Top K Frequent Elements)
class Solution(object): def topKFrequent(self, nums, k): d = {} res = [] for i in nums: if i in d.keys(): d[i] += 1 else: ...原创 2018-07-31 18:00:11 · 774 阅读 · 1 评论