add recursive soln.

This commit is contained in:
=
2020-06-03 15:28:01 +02:00
parent d8da439590
commit 345d09b69e
4 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
def sum_array(arr):
if not arr:
return 0
return arr[0] + sum_array(arr[1:])