摘要:
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import datetime as dt import warnings warnings.filterwarn 阅读全文
posted @ 2022-07-11 19:47
是冰美式诶
阅读(152)
评论(0)
推荐(0)
摘要:
#利用栈的特性,先进后处,刚好进行比较,{[()]}分别进行比较 class Solution: def isValid(self, s: str) -> bool: stk = [] for c in s: # 如果c是 ({[ 则入栈 if c in ['(','[','{']: stk.app 阅读全文
posted @ 2022-07-11 17:47
是冰美式诶
阅读(35)
评论(0)
推荐(0)
摘要:
#循环迭代 # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solutio 阅读全文
posted @ 2022-07-11 16:15
是冰美式诶
阅读(32)
评论(0)
推荐(0)
摘要:
#三数之和双指针循环外再加一个循环,但有些细节还是在里面的,需注意 def fourSum(self, nums: List[int], target: int) -> List[List[int]]: res = [] #设置空列表做返回值 if len(nums)<4 : return res 阅读全文
posted @ 2022-07-11 15:01
是冰美式诶
阅读(25)
评论(0)
推荐(0)