Travis build: 943
This commit is contained in:
@ -1,7 +1,2 @@
|
||||
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)
|
||||
def count_occurrences(lst, val):
|
||||
return len([x for x in lst if x == val and type(x) == type(val)])
|
||||
Reference in New Issue
Block a user