class Solution {
public :
int sumOfUnique(vector& nums) {
vector v;
for(auto i:nums)
if(count(nums.begin(), nums.end(), i) != 1) // taking values whose count is 1
// are whose values is repaeted once //
{
v.push_back(0);}
// values which are repaeted once are s
// simply pushed into vetcor v//
else
{
v.push_back(i);
}
int sum=accumulate(v.begin(), v.end(), 0);
// syntax accumulate = (first ,last, 0)
// where fist and last gives us the range and 0 is the value of initial sum
// that is initialized to 0//
// accumulate func gives sum of values presnet in vector v
return sum;
cout<<sum<<endl;
} };