leetcode1078
时间:2019-06-09 20:35:22
收藏:0
阅读:107
1 class Solution: 2 def findOcurrences(self, text: str, first: str, second: str) -> ‘List[str]‘: 3 ary = text.split(‘ ‘) 4 n = len(ary) 5 result = list() 6 for i in range(n): 7 if ary[i] == first and i+1<n-1 and ary[i+1] == second: 8 result.append(ary[i+2]) 9 return result
原文:https://www.cnblogs.com/asenyang/p/10994614.html
评论(0)