Ad
Code
Diff
  • def sum(arr):
        def s(a):
            res=0
            for i in arr:
                res+=i
            return res
        return 0 if not arr else s(arr)
        
    • def sum(arr):
    • result = 0
    • for i in arr:
    • result += i
    • return result
    • def s(a):
    • res=0
    • for i in arr:
    • res+=i
    • return res
    • return 0 if not arr else s(arr)