Merge pull request #12 from cclauss/patch-2
from functools import reduce in count_occurences.py
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user