1#include <bits/stdc++.h>
2#include <iostream>
3#include <map>
4#include <unordered_map>
5
6using namespace std;
7
8int main() {
9 map<char, int> M; //based on balanced binary tree takes O(logn) access time
10 unordered_map<char, int> U; //uses hashing and accessing elements takes O(1)
11 //U.add(key,value);
12 //U.erase(key,value);
13
14 //map each letter to their occurance
15 string s = "Sumant Tirkey";
16 for (char c : s) {
17 M[c]++;
18 }
19 for (char c : s){
20 U[c]++;
21 }
22
23 return 0;
24}