UML建模工具列表更新。 工具 厂商 价格 运行平台 代码工程 编程环境 XMI 备注 推荐 Astah UML 8.1 Change Vision(日本) $1190-$8900每年10人,Community版免费 Java、Linux、MacOS、Windows C#、C++、Java、Obje ...
分类:
其他好文 时间:
2020-06-08 23:41:31
阅读次数:
89
逐位计算 思路: 遍历字符串,逐位加和,用一个变量记录是否产生进位。 class Solution: def addBinary(self, a: str, b: str) -> str: res = '' if len(a)<len(b): a,b = b,a temp = 0 for i in ...
分类:
其他好文 时间:
2020-06-08 19:04:04
阅读次数:
49
思路:递归。 终止条件是两个节点都为空,return True; 或者两个节点中有一个为空,return False; 或者两个节点的值不相等,return False; class Solution(object): def isSymmetric(self, root): """ :type r ...
分类:
其他好文 时间:
2020-06-08 15:02:40
阅读次数:
49
思路:二分法。 class Solution(object): def nextGreatestLetter(self, letters, target): letters = list(set(letters)) letters.sort() if target in letters: index ...
分类:
其他好文 时间:
2020-06-08 14:52:54
阅读次数:
44
class Solution(object): def isSubsequence(self, s, t): """ :type s: str :type t: str :rtype: bool """ if len(s) > len(t): return False elif len(s) == ...
分类:
其他好文 时间:
2020-06-08 14:51:19
阅读次数:
47
class Solution(object): def kWeakestRows(self, mat, k): """ :type mat: List[List[int]] :type k: int :rtype: List[int] """ power = [sum(line) for line ...
分类:
其他好文 时间:
2020-06-08 14:49:39
阅读次数:
59
class Solution(object): def maxDepthAfterSplit(self, seq): """ :type seq: str :rtype: List[int] """ res = [] if not seq: return res depth, max_depth = ...
分类:
其他好文 时间:
2020-06-08 14:48:42
阅读次数:
46
class Solution(object): def isSameTree(self, p, q): """ :type p: TreeNode :type q: TreeNode :rtype: bool """ # 根节点值不同,树不同 if p.val != q.val: return Fa ...
分类:
其他好文 时间:
2020-06-08 14:46:48
阅读次数:
57
方法一:二分查找。 class Solution(object): # 二分查找 def kthSmallest(self, matrix, k): """ :type matrix: List[List[int]] :type k: int :rtype: int """ n = len(matr ...
分类:
其他好文 时间:
2020-06-08 14:43:04
阅读次数:
48
方法一:二分查找。 class Solution(object): # 二分法 def countNegatives(self, grid): """ :type grid: List[List[int]] :rtype: int """ ans = 0 for nums in grid: if n ...
分类:
其他好文 时间:
2020-06-08 14:39:50
阅读次数:
58