Tap here to switch tabs
Problem
Submissions

Problem: Sum of Unique Elements

Sum of Unique Elements asks you to examine an integer array and return the total of values that occur exactly once, excluding every value that appears more than once.

Statement

You are given an integer array nums. The unique elements of an array are the elements that appear exactly once in that array.

Return the sum of all unique elements in nums.

Constraints:

  • 1≤1 \le nums.length ≤100\le 100

  • 1≤1 \le nums[i] ≤100\le 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Unique Elements

Sum of Unique Elements asks you to examine an integer array and return the total of values that occur exactly once, excluding every value that appears more than once.

Statement

You are given an integer array nums. The unique elements of an array are the elements that appear exactly once in that array.

Return the sum of all unique elements in nums.

Constraints:

  • 1≤1 \le nums.length ≤100\le 100

  • 1≤1 \le nums[i] ≤100\le 100