HackerRank 'Simple Array Sum' Solution

Martin Kysel · October 25, 2020

Short Problem Definition:

Given an array of integers, find the sum of its elements.

Simple Array Sum

Complexity:

time complexity is O(N)

space complexity is O(1)

Execution:

Just sum it up.

Solution:
def simpleArraySum(ar):
    return sum(ar)

Twitter, Facebook

To learn more about solving Coding Challenges in Python, I recommend these courses: Educative.io Python Algorithms, Educative.io Python Coding Interview.