Ad
Code
Diff
  • def sum(arr):
        if len(arr) == 1:
            return arr[0]
        else:
            return list(map(lambda x: x + x, arr))[-1]
    • def sum(arr):
    • result = 0
    • for i in arr:
    • result += i
    • return result
    • if len(arr) == 1:
    • return arr[0]
    • else:
    • return list(map(lambda x: x + x, arr))[-1]