We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17dbaeb commit 208b48eCopy full SHA for 208b48e
scripts/algorithms/U/Unique Number of Occurrences/Unique Number of Occurrences.cpp
@@ -1,3 +1,4 @@
1
+// Runtime: 4 ms (Top 63.35%) | Memory: 8.2 MB (Top 47.42%)
2
class Solution {
3
public:
4
bool uniqueOccurrences(vector<int>& arr) {
@@ -6,14 +7,14 @@ class Solution {
6
7
for(int i=0;i<arr.size();i++){
8
sk[arr[i]]++;
9
}
- for(auto j : sk)
10
+ for(auto j : sk)
11
{
12
if(skk[j.second]==1){
13
return false;
14
- skk[j.second]++;
15
+ skk[j.second]++;
16
-
17
+
18
return true;
19
-};
20
+};
0 commit comments