Commit ff7c863a by 安晓东

Update homework_01.py

parent 627a9269
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
# J = "z" # J = "z"
# S = "ZZ" # S = "ZZ"
# numJewelsInStones(J, S) # numJewelsInStones(J, S)
# 宝石与石头 # 山峰数组
# def peakIndexInMountainArray(A): # def peakIndexInMountainArray(A):
# """ # """
# :type A: List[int] # :type A: List[int]
...@@ -45,6 +45,16 @@ ...@@ -45,6 +45,16 @@
# return A.index(max(A)) # return A.index(max(A))
# peakIndexInMountainArray([0,1,0]) # 预期输出 1 # peakIndexInMountainArray([0,1,0]) # 预期输出 1
# 宝石与石头
# def numJewelsInStones(J, S):
# """
# :type J: str
# :type S: str
# :rtype: int
# """
# return sum([s in J for s in S])
# numJewelsInStones("aA","aAAbbbb") # 预期输出 3
import re import re
s ='1324.231.432.1234,192.168.1.6,10.25.11.8这些信息中,哪些是ip呢?' s ='1324.231.432.1234,192.168.1.6,10.25.11.8这些信息中,哪些是ip呢?'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment