7 lines
172 B
Python
7 lines
172 B
Python
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) |