摘要:
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution 阅读全文
posted @ 2019-03-17 16:09
AceKo
阅读(206)
评论(0)
推荐(0)
摘要:
class Solution(object): def ladderLength(self, beginWord, endWord, wordList): """ :type beginWord: str :type endWord: str :type wordList: List[str] :r 阅读全文
posted @ 2019-03-17 16:08
AceKo
阅读(166)
评论(0)
推荐(0)
摘要:
class Solution(object): def findLadders(self, beginWord, endWord, wordlist): """ :type beginWord: str :type endWord: str :type wordlist: Set[str] :rty 阅读全文
posted @ 2019-03-17 16:03
AceKo
阅读(118)
评论(0)
推荐(0)
摘要:
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution 阅读全文
posted @ 2019-03-17 16:02
AceKo
阅读(95)
评论(0)
推荐(0)
摘要:
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution 阅读全文
posted @ 2019-03-17 16:01
AceKo
阅读(189)
评论(0)
推荐(0)
摘要:
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution 阅读全文
posted @ 2019-03-17 16:00
AceKo
阅读(210)
评论(0)
推荐(0)
摘要:
class Solution(object): def inorderTraversal(self, root): """ :type root: TreeNode :rtype """ res = [] self.order(root, res) return res def order(self 阅读全文
posted @ 2019-03-17 15:58
AceKo
阅读(128)
评论(0)
推荐(0)
摘要:
class Solution(object): def inorderTraversal(self, root): """ :type root: TreeNode :rtype """ class Command(object): def __init__(self,com,node): self 阅读全文
posted @ 2019-03-17 15:58
AceKo
阅读(153)
评论(0)
推荐(0)
摘要:
#coding=utf-8#看到这种来来回回,增增删删的题,一般都想到用栈。#我们把字符串按照/分割之后就得到了每个文件的目录,然后判断路径是添加还是向上层进行返回。这个题很简单了。#有一个地方犯了小错误,不能写成if dir == ‘..’ and stack: stack.pop()。这样的话如 阅读全文
posted @ 2019-03-17 15:57
AceKo
阅读(79)
评论(0)
推荐(0)
摘要:
# Definition for singly-linked list.class ListNode(object): def __init__(self, x): self.val = x self.next = Noneclass Solution(object): def mergeKList 阅读全文
posted @ 2019-03-17 15:56
AceKo
阅读(86)
评论(0)
推荐(0)