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.
- Prepare
- Algorithms
- Warmup
- Simple Array Sum
- Discussions
Simple Array Sum
Simple Array Sum
Sort by
recency
|
3450 Discussions
|
Please Login in order to post a comment
TypeScript solution function simpleArraySum(ar: number[]): number { return ar.reduce((acc, val) => acc + val, 0); }
const input = require('fs').readFileSync(0, 'utf-8').split('\n'); const arr = input[1].split(' ').map(Number); console.log(simpleArraySum(arr));
int sum = 0; for (int i = 0; i < ar.Count; i++) { sum =sum+ ar[i]; } return sum; }
int simpleArraySum(vector ar) { int sum = 0; for(int i = 0; i < ar.size(); i++){ sum += ar[i]; } return sum; } //c++
Elite Aviations offers specialized air cargo charter services with a focus on speed, security, and tailored logistics solutions. Their global network ensures efficient transportation for urgent and high-value shipments.
Elite Aviations offers specialized air cargo charter services with a focus on speed, security, and tailored logistics solutions. Their global network ensures efficient transportation for urgent and high-value shipments.