From 55a3231d2890342f5248ebe5dee38135f9c32489 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 20 Feb 2018 16:11:35 +0100 Subject: [PATCH] from functools import reduce in count_occurences.py --- test/count_occurences/count_occurences.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/count_occurences/count_occurences.py b/test/count_occurences/count_occurences.py index e98edff74..5295e644a 100644 --- a/test/count_occurences/count_occurences.py +++ b/test/count_occurences/count_occurences.py @@ -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) \ No newline at end of file + arr)