标签:span get false self offer 剑指offer col HERE not
1 # -*- coding:utf-8 -*- 2 class Solution: 3 def GetNumberOfK(self, data, k): 4 n = len(data) 5 if n == 0: 6 return 0 7 cnt = 0 8 find = False 9 for i in range(n): 10 if data[i] == k: 11 cnt += 1 12 if not find: 13 find = True 14 else: 15 if find: 16 break 17 return cnt 18 # write code here
标签:span get false self offer 剑指offer col HERE not
原文地址:https://www.cnblogs.com/asenyang/p/11023602.html