摘要:
这不是我写的,对于树的学习处于初始阶段。 class Solution(object): def inorderTraversal(self, root): """ :type root: TreeNode :rtype: List[int] """ white,gray=0,1 res=[] st 阅读全文
摘要:
class Solution(object): def removeKdigits(self, num, k): """ :type num: str :type k: int :rtype: str """ if k>=len(num): return '0' i=0 j=1 while k an 阅读全文
摘要:
这道题也不是我自己做出来的,只能说大佬牛逼!!! class Solution(object): def decodeString(self, s): """ :type s: str :rtype: str """ stack, res, multi = [], "", 0 for c in s: 阅读全文
摘要:
这道题也不是我自己想出来的。。。 执行用时 :32 ms, 在所有 python 提交中击败了62.20%的用户 内存消耗 :11.7 MB, 在所有 python 提交中击败了44.44%的用户 ——2019.11.4 阅读全文
摘要:
这个也不是我自己做出来的,感觉我还打不到这个水平,我好菜! class Solution: def maximalRectangle(self, matrix) -> int: if not matrix or not matrix[0]: return 0 row = len(matrix) co 阅读全文
摘要:
class Solution(object): def largestRectangleArea(self, heights): """ :type heights: List[int] :rtype: int """ stack = [] heights = [0] + heights + [0] 阅读全文
摘要:
执行用时 :132 ms, 在所有 python 提交中击败了81.56%的用户 内存消耗 :12.2 MB, 在所有 python 提交中击败了37.93%的用户 ——2019.11.2 阅读全文
摘要:
执行用时 :16 ms, 在所有 python 提交中击败了93.78%的用户 内存消耗 :11.8 MB, 在所有 python 提交中击败了19.05%的用户 ——2019.11.2 阅读全文
摘要:
执行用时 :248 ms, 在所有 python 提交中击败了58.82%的用户 内存消耗 :13.6 MB, 在所有 python 提交中击败了34.65%的用户 ——2019.11.2 阅读全文
摘要:
执行用时 :76 ms, 在所有 python 提交中击败了36.29%的用户 内存消耗 :11.8 MB, 在所有 python 提交中击败了38.18%的用户 ——2019.11.2 阅读全文