本文共 117 字,大约阅读时间需要 1 分钟。
统计一个数字在排序数组中出现的次数。
class Solution: def GetNumberOfK(self, data, k): return data.count(k)
转载地址:http://effab.baihongyu.com/