Daily Coding Challenge
Solve today's challenge, earn streaks, and climb the leaderboard!
Share this challenge:
EASY
Released: February 25, 2026 at 12:32 AM
Sum Array Elements
Calculate the sum of all numbers in a given array. Return the total sum.
Problem Statement
Given an array of integers `nums`, your task is to return the sum of all its elements. The array will only contain non-negative integers. The input array `nums` can be empty or contain a single element. Your solution function will receive the array directly as input.
Example Test Cases
Input:
nums = [1, 2, 3]
Output:
6
Explanation:
The sum of 1, 2, and 3 is 6.
Input:
nums = [10, 20]
Output:
30
Explanation:
The sum of 10 and 20 is 30.
Sign in to save your progress and compete on the leaderboard
Leaderboard
Sum Array Elements
No submissions yet for this filter
Be the first to solve this challenge!