Question: Cpp language only. 7. Sum up the unique elements (15 points] Write a function with the following signature: int sum_unique(int arr[], int size) Your function
Cpp language only.
![Cpp language only. 7. Sum up the unique elements (15 points] Write](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a1032f43e_49866f3a102d0569.jpg)
7. Sum up the unique elements (15 points] Write a function with the following signature: int sum_unique(int arr[], int size) Your function should take in an array of integers and its size, and it should return the sum of unique elements in the array. You may assume that the elements in the array will be in the 0.99 range. Exmple Input: [1, 2, 3, 3] Output: 6 Explanation: We do not include the last element in the summation because we have already encountered a 3 before
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
