We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The executer for python actually forces you to use the provided code template. So in the following code you CANNOT remove extra lines (i.e. "import sys" and "n = int(raw_input().strip()"). None of these two lines are required!
import sys
n = int(raw_input().strip())
arr = map(int,raw_input().strip().split(' '))
print sum(arr)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
The executer for python actually forces you to use the provided code template. So in the following code you CANNOT remove extra lines (i.e. "import sys" and "n = int(raw_input().strip()"). None of these two lines are required!
import sys
n = int(raw_input().strip()) arr = map(int,raw_input().strip().split(' ')) print sum(arr)