Skip to main content

Posts

Showing posts with the label Maps

Maps-STL Hackerrank Solution in C++

 Maps-STL Hackerrank Solution C++ For Explanation Watch Video:: Sample Input 7 1 Jesse 20 1 Jess 12 1 Jess 18 3 Jess 3 Jesse 2 Jess 3 Jess Sample Output 30 20 0 Code: #include   < cmath > #include   < cstdio > #include   < vector > #include   < iostream > #include   < set > #include   < map > #include   < algorithm > using   namespace  std; int  main() {      /* Enter your code here. Read input from STDIN. Print output to STDOUT */          int  q;     cin>>q;     map<string, int >m;      int  type;     string name;      for ( int  i= 0 ;i<q;i++){         cin>>type>>name;   ...