Definition at line 5 of file main.cpp.
◆ uniqueOccurrences()
| bool Solution::uniqueOccurrences |
( |
vector< int > & |
arr | ) |
|
|
inline |
Definition at line 8 of file main.cpp.
9 {
10 unordered_map<int, int> occurrences;
11 for (int el: arr)
12 occurrences[el]++;
13
14 set<int> unique_occurrences;
15 for (pair<int, int> pairs: occurrences)
16 {
17 int el = pairs.second;
18 if (unique_occurrences.find(el) != unique_occurrences.end())
19 return false;
20 else
21 unique_occurrences.insert(el);
22 }
23 return true;
24 }
The documentation for this class was generated from the following file: