I am passing a string array and an empty map as input;
if the element in array is in map, it should increase the value of index in map else it should just add the key and index into map.
#include <iostream>
#include <map>
#include <iterator>
using namespace std;
int main()
{
string array[5]={"val","nir","sas","nir","val"};
map<string,int> mapone={};
map<string,int>::iterator itr;
string check;
int i;