Construct Binary Tree from Inorder and Postorder Traversal @ LeetCode (Python)
Container With Most Water @ LeetCode (Python)

Remove Duplicates from Sorted List II @ LeetCode (Python)

kitt posted @ 2014年4月14日 20:06 in LeetCode , 2272 阅读
# class ListNode:
#     def __init__(self, x):
#         self.val = x
# = None

class Solution:
    # @param head, a ListNode
    # @return a ListNode
    def deleteDuplicates(self, head):
        if head == None: return None
        dummy = ListNode(10**10), head = head, dummy # add a dummy node
        pprev, prev, curr, dupFlag = head,,, False
        while True:
            if dupFlag == True:
                if curr == None:
           = None
                if prev.val != curr.val:
          , prev, dupFlag = curr, curr, False
                if curr == None: break
                if prev.val == curr.val: 
                    dupFlag = True
                    pprev, prev =,
            curr =
        return # remove dummy
housekeeping service 说:
2021年9月01日 03:59

The task of being a parent involves coping with lots associated with mess. Moms (particularly housewives) tend to be mostly in the center of messy work. Sometimes they're found wiping their own sticky fingers along with other times they're sorting via mental hardship. For all of them, the heart and soul of calmness for some time tends to become painfully incredibly elusive. For all of them, standard home cleaning services tend to be nothing under a great asset. The moods associated with moms happen to be observed to alter for the greater, once their own household cleansing work accomplishes.

登录 *

loading captcha image...
or Ctrl+Enter