排序集合有一個內建的 mapciVar.count('i') 成員函式,效率最高。但對於序列集合,需要使用 count() 演算法。
mapciVar.count('i')
count()
關於計數演算法的更多資訊(包括互動式示例)