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,
CCTV :Tiktok A lawsuit shows the attitude and determination of safeguarding rights 【JAVA】【 Huawei campus recruitment written examination - Software 】2020-09-09ELementUI select Multi select drop-down box to get all properties of the selected item Vue Development tips Maximum security risk of cloud computing : Unclear safety responsibility uboot set up nfs parameter ——linux kernel use nfs Mode to load the root file system rootfs( Six )python3 Read the file and specify a few lines , And write to another file Golang Array bisection , Array split , Array grouping ( Essence )2020 year 6 month 26 day C# Class library File read and write operation help class vue use THREE.js Create a cube that you can control