Answers for "how to find a pair in a map of pair"

0

how to find a pair in a map of pair

ok is a map<pair<int,int>,int>;
d and k are random variables that needed to be made into a pair and put into map.

         if(ok.find({d,k})==ok.end())
             ok.insert({{d,k},1});
         else
             ok[{d,k}]++;
         cout<<ok[{d,k}]<<" ";
Posted by: Guest on September-26-2021

Browse Popular Code Answers by Language