Files
grokking_algorithms/03_recursion/python/04_count.py
2020-06-03 15:28:01 +02:00

4 lines
78 B
Python

def count(arr):
if not arr:
return 0
return 1 + count(arr[1:])