Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #12 from cclauss/patch-2
Browse files Browse the repository at this point in the history
 from functools import reduce in count_occurences.py
  • Loading branch information
rohitanwar committed Feb 20, 2018
2 parents 4d3263d + 55a3231 commit 7aed10c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/count_occurences/count_occurences.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 7aed10c

Please sign in to comment.