Merge pull request #12 from cclauss/patch-2

from functools import reduce in count_occurences.py
This commit is contained in:
Rohit Tanwar
2018-02-20 22:02:15 +05:30
committed by GitHub

View File

@ -1,4 +1,7 @@
from functools import reduce
def count_occurences(arr, val):
return reduce(
(lambda x, y: x + 1 if y == val and type(y) == type(val) else x + 0),
arr)
arr)