![]() |
VOOZH | about |
A C++ map and unordered_map are initialized to some keys and their respective mapped values.
Examples:
Input :
Map : 1 -> 4, 2 -> 6, 4 -> 6
Check1 : 5, Check2 : 4
Output : 5 : Not present, 4 : Present
C++ implementation :
Output:
5: Not Present
4: Present
Approach 2nd:
we can also use the count function of the map in c++.
Implementation:
1. Map
Output:
5: Not Present
4: Present
2. Unordered Map
Output:
5: Not Present
4: Present