Brush the topic study :


160 Linked list intersection node search python realization

def getIntersectionNode(self, headA, headB):
        :type head1, head1: ListNode
        :rtype: ListNode
        a,b = 0,0
        p,q = headA,headB
        while headA and headB:
            headA,headB =,
            a,b = a+1,b+1
        while headA:
            headA,p =,
        while headB:
            headB,q =,
        while p:
            if p==q:
                return p
            p,q =,
        if not headA or not headB:# Empty list detection , No matter who comes back empty
        p,q = headA,headB
        while p!=q:# Parallel comparison of linked list nodes value, Complexity O(N)
            p = if p else headB
            q = if q else headA
        return p 

241 class Solution:
    def diffWaysToCompute(self, input: str) -> List[int]:  
       #241 Divide and rule
        res = []
        ops = {'+':lambda x,y:x+y, '-':lambda x,y:x-y, '*':lambda x,y:x*y}
        for indx in range(1,len(input)-1):
            if input[indx] in ops.keys():             
                for left in self.diffWaysToCompute(input[:indx]):
                    for right in self.diffWaysToCompute(input[indx+1:]):
        if not res:
        return res

242 String to determine whether the same ectopic class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        if len(s)!=len(t):
            return False
        for i in s_:
            if i in s_res.keys():
        for j in t_:
            if j in t_res.keys():
        if len(s_res.items()&t_res.items())==len(s_res):
            return True
            return False

232 Stack queue
class MyQueue(object): def __init__(self): self.input = [] self.output = []
def push(self, x): self.input.append(x) def pop(self): if self.output: return
self.output.pop() else: while self.input: self.output.append(self.input.pop())
return self.output.pop() def peek(self): if self.output: return self.output[-1]
else: while self.input: self.output.append(self.input.pop()) return
self.output[-1] def empty(self): return len(self.input) == 0 and
len(self.output) == 0

©2019-2020 Toolsou All rights reserved,
java Four functional interfaces ( a key , simple )os Simple use of module HashMap Explain in detail html Writing about cherry trees , Writing about cherry trees It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) computer network --- Basic concepts of computer network ( agreement , system ) Some East 14 Pay change 16 salary , Sincerity or routine ? Browser kernel ( understand )