We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If it does not match key of any element in the map, new element is created.
Default allocator calls default constructor, and default "constructor" int() returns 0.
If your hash table implementation works diffetent you could manually check that key it does not exists and create new element initialized with 0.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
If it does not match key of any element in the map, new element is created. Default allocator calls default constructor, and default "constructor" int() returns 0.
If your hash table implementation works diffetent you could manually check that key it does not exists and create new element initialized with 0.