摘要:
https://blog.csdn.net/zouxy09/article/details/8683859 阅读全文
摘要:
转:https://blog.csdn.net/hacker_long/article/details/85054085 阅读全文
摘要:
转自:https://zhuanlan.zhihu.com/p/31886934 目录 SVM简介线性SVM算法原理非线性SVM算法原理 SVM简介 支持向量机(support vector machines, SVM)是一种二分类模型,它的基本模型是定义在特征空间上的间隔最大的线性分类器,间隔最大 阅读全文
摘要:
class Solution: def hammingDistance(self, x: int, y: int) -> int: z = x^y z = (z&0x55555555)+((z>>1)&0x55555555) z = (z&0x33333333)+((z>>2)&0x33333333 阅读全文
摘要:
class Solution: def diStringMatch(self, S: str) -> List[int]: A=[i for i in range(len(S)+1)] res = A for index,s in enumerate(S): if s is 'I': A[index 阅读全文
摘要:
class Solution: def judgeCircle(self, moves: str) -> bool: u,d,l,r = 0,0,0,0 for move in moves: if move is 'U': u += 1 elif move is 'D': d += 1 elif m 阅读全文
摘要:
class Solution: def calcu(self,ele:List[str],loc): index_p = [-1]*2 #只记录离R最近位置的p和B(左右) index_B = [-1]*2 left,right = 0,0 for i in range(len(ele)): if 阅读全文
摘要:
class Solution: def flipAndInvertImage(self, A: List[List[int]]) -> List[List[int]]: for a in A: first = 0 last = len(a)-1 while first<last: a[first], 阅读全文
摘要:
class Solution: def sortArrayByParity(self, A: List[int]) -> List[int]: first = 0 last = len(A)-1 while first<last: m = A[first] n = A[last] if (m&1 i 阅读全文
摘要:
class Solution: def sortedSquares(self, A: List[int]) -> List[int]: sqr = [] for a in A: sqr.append((a)**2) return sorted(sqr) 184ms,15.2M 优化一: class 阅读全文