Simple Array Sum

Sort by

recency

|

3450 Discussions

|

  • + 0 comments

    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));

  • + 0 comments

    int sum = 0; for (int i = 0; i < ar.Count; i++) { sum =sum+ ar[i]; } return sum; }

  • + 0 comments

    int simpleArraySum(vector ar) { int sum = 0; for(int i = 0; i < ar.size(); i++){ sum += ar[i]; } return sum; } //c++

  • + 0 comments

    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.

  • + 0 comments

    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.