Linux下AutoDockTools、AutoGrid与AutoDock安装及分子对接全流程实战
2026/10/5 3:10:07
139 单词拆分
class Solution: def wordBreak(self, s: str, wordDict: List[str]) -> bool: word=set(wordDict) n=len(s) max_len=max(map(len,wordDict)) f=[True]+[False]*n for i in range(1,n+1): for j in range(i-1,max(-1,i-1-max_len),-1): if f[j] and s[j:i] in word: f[i]=True break return f[n]300 最长递增子序列
class Solution: def lengthOfLIS(self, nums: list[int]) -> int: f=[0]*len(nums) for i,x in enumerate(nums): for j,y in enumerate(nums[:i]): if x>y:f[i]=max(f[i],f[j]) f[i]+=1 return max(f)