51
Dev开发社区
首页
文章
问答
工具
搜索
登录
注册
#Etc
leetcode 46-> Permutations
Givenacollectionof distinct integers,returnallpossiblepermutations.classSolution(object):defpermute(self,nums):""":typenums:List[int]:rtype:List...
代码星球
·
2020-08-09
leetcode
Permutations
leetcode 29-> Divide Two Integers without using multiplication, division and mod operator
classSolution(object):defdivide(self,dividend,divisor):""":typedividend:int:typedivisor:int:rtype:int"""ispositive=Trueifdividend>0anddivisor<0:ispo...
代码星球
·
2020-08-09
leetcode
Divide
Two
Integers
without
leetcode 19-> Remove Nth Node From End of List
#Definitionforsingly-linkedlist.#classListNode(object):#def__init__(self,x):#self.val=x#self.next=NoneclassSolution(object):defremoveNthFromEnd(self,head,...
代码星球
·
2020-08-09
leetcode
Remove
Nth
Node
From
leetcode 18-> 4Sum
classSolution(object):deffourSum(self,nums,target):""":typenums:List[int]:typetarget:int:rtype:List[List[int]]"""l=len(nums)nums.sort()ifl<4:return[]re...
代码星球
·
2020-08-09
leetcode
4Sum
leetcode 17-> Letter Combinations of a Phone Number
classSolution(object):defletterCombinations(self,digits):""":typedigits:str:rtype:List[str]"""ifdigits=="":return[]nums_to_letters={2:"abc",3:"def",4:"ghi...
代码星球
·
2020-08-09
leetcode
Letter
Combinations
of
Phone
leetcode 16-> 3Sum Closest
Givenanarray nums of n integersandaninteger target,findthreeintegersin nums suchthatthesumisclosestto target.Retur...
代码星球
·
2020-08-09
leetcode
3Sum
Closest
leetcode 15-> 3Sum
classSolution(object):defthreeSum(self,nums):res=[]nums.sort()foriinxrange(len(nums)-2):ifi>0andnums[i]==nums[i-1]:continuel,r=i+1,len(nums)-1whilel<...
代码星球
·
2020-08-09
leetcode
3Sum
leetcode 14-> Longest Common Prefix
note:Allgiveninputsareinlowercaseletters a-z.classSolution(object):deflongestCommonPrefix(self,strs):""":typestrs:List[str]:rtype:str"""iflen(strs)==...
代码星球
·
2020-08-09
leetcode
Longest
Common
Prefix
leetcode 13 -> Roman to Integer
classSolution(object):defromanToInt(self,s):""":types:str:rtype:int"""lista={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}Value_sum=0last_Value=0for...
代码星球
·
2020-08-09
leetcode
Roman
to
Integer
/etc/postfix下 main.cf 配置文件详解
转自:https://www.cnblogs.com/qianyuliang/p/6501531.htmlpostconf-n#别名数据库(postalias/newaliases命令生成) alias_database=hash:/etc/postfix/aliases#别名表,列出localmda所使用的...
代码星球
·
2020-08-09
etc
postfix
main.cf
配置文件
详解
leetcode 12 -> Integer to Roman
classSolution(object):defintToRoman(self,num):""":typenum:int:rtype:str"""ifnum==0:return""ifnum>=1000:return"M"+self.intToRoman(num-1000)elifnum>=9...
代码星球
·
2020-08-09
leetcode
Integer
to
Roman
leetcode 9 -> Palindrome Number
classSolution(object):defisPalindrome(self,x):""":typex:int:rtype:bool"""s=str(x)if(s==s[::-1]):returnTrueelse:returnFalse ...
代码星球
·
2020-08-09
leetcode
Palindrome
Number
leetcode 5-> Longest Palindromic Substring
classSolution(object):defget_f_l(self,s_length,s,list_all,last_d):max_l=0first_d=0last_d=0foriinrange(len(list_all)):if((i+1)==len(list_all)):breakforjinr...
代码星球
·
2020-08-09
leetcode
Longest
Palindromic
Substring
leetcode 7-> Reverse Integer(32-bit signed integer)
classSolution(object):defreverse(self,x):""":typex:int:rtype:int"""p=abs(x)rev=int(str(p)[::-1])if(x<0):if((-rev)<pow(-2,31)):return0else:return-(re...
代码星球
·
2020-08-09
leetcode
Reverse
Integer
32-bit
signed
leetcode 4-> Median of Two Sorted Arrays
classSolution(object):defhb(self,list1,list2):result=[]whilelist1andlist2:iflist1[0]<list2[0]:result.append(list1[0])dellist1[0]else:result.append(list...
代码星球
·
2020-08-09
leetcode
Median
of
Two
Sorted
首页
上一页
...
37
38
39
40
41
...
下一页
尾页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他