Distribute Candies LeetCode solution in C++

1
class Solution {
2
public:
3
int distributeCandies(vector<int> &candyType) {
4
unordered_set<int> s(candyType.begin(), candyType.end());
5
return min(candyType.size() / 2, s.size());
6
}
7
};
8
// if you like the solution plz upvote.

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0