First Missing Positive (Python)
Flatten Binary Tree to Linked List (Python)

Path Sum (Python)

kitt posted @ 2014年2月08日 17:26 in LeetCode , 2012 阅读

树的题一开始要讨论root是否为空

# class TreeNode:
#     def __init__(self, x):
#         self.val = x
#         self.left = None
#         self.right = None

class Solution:
    # @param root, a tree node
    # @param sum, an integer
    # @return a boolean
    def hasPathSum(self, root, sum):
        if root == None: return False
        if root.val == sum and root.left == None and root.right == None: return True
        if root.left != None and self.hasPathSum(root.left, sum - root.val): return True
        if root.right != None and self.hasPathSum(root.right, sum - root.val): return True
        return False
Avatar_small
cleaning services ab 说:
2019年10月24日 09:10

Knowledge in strong cleaning tile floors is probably the most important logic behind why business masters and property owners trust specialist cleaners and you should too. It isn't enough to grab the washing tools and also products from your store, but you will need to have in-depth information about what products to utilize for your specific type regarding tile. As an example, what operates for ceramic tiles may well not work around the granite tiles. If you utilize the completely wrong cleaner, it could stain and also permanently injury your tiles. You could have to totally replace the tile floor, which costs big money.

Avatar_small
cleaning company dub 说:
2021年8月26日 01:28

Probably the most important points while performing the cleansing services would be to prioritize your own cleaning work and arrange it using the cleaners. Depends upon the job you have to arrange the actual cleaning work when it needs to be done which day or even week. So the cleaning is created easy through arranging the times which tend to be convenient for that customers too. Through the correct cleaning strategy and arranging ensures to wash all the actual surfaces and keep your things secure.

Avatar_small
maid services dubai 说:
2021年9月18日 00:16

You require a spray bottle to mix water together with baking soda. Now, add vinegar there. A minor reaction needs place mainly because white vinegar contains acetic stomach acid and standard water, and making cookies soda features salt. These days, add a handful of drops for oil together with shake it all properly and do it.

Avatar_small
maids in dubai 说:
2021年9月30日 13:07

Enterprise cleaning nowadays may be of many different types. A company may be contracted ahead in once per month or in like manner do key clean-up careers like flooring waxing, dusting, drapes and window treatments and some other major careers. Often organizations that retain the services of in professionals once per month are having someone maintain the house during one other parts with the month.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter