cpp unordered map has key

Solutions on MaxInterview for cpp unordered map has key by the best coders in the world

showing results for - "cpp unordered map has key"
Erica
18 Feb 2016
1// Function to check if the key is present or not
2string check_key(map<int, int> m, int key)
3{
4    // Key is not present
5    if (m.find(key) == m.end())
6        return "Not Present";
7  
8    return "Present";
9}