problem : CodeChef: Practical coding for everyone
my soultion : CodeChef: Practical coding for everyone
I just want to know that - why same iterator can’t be used two times?
In my solution, when I use “iterator itr” again then it gives compile time error (while compile on ubuntu) but when I replace it with different name then it works fine. In my case I used “iterator i”.
and one more question -
Can we access element in map using its key?
e.g -
map<string, int>mp;
mp.insert({“abc”, 1});
How to print 1 using its key “abc”?
I am new in c++.