size(): This function is available in the File: unordered_set.h. This function is a build-in function in STL of C++. This function returns the number of elements in the unordered_set.
Syntax:
std::size_t std::unordered_set<int>::size() const
This function returns the size of the unordered_set.
Parameters: NA
File: unordered_set.h
Approach
C++
#include <bits/stdc++.h>using namespace std;int main(){unordered_set<int> st = {1, 2, 3, 4, 5};cout << st.size() << "\n";return 0;}
Output:
5
No comments:
Post a Comment