count the character in string

Problem Statement
Given a string ,Write a program to print letter followed by it’s frequency.
Input Format
input must be in string
Output Format
count the characters.. and print the alphabet and its count adjacently
Sample Input
aaabcc
Sample Output
a3b1c2

My Code:


#include <iostream>
#include<string.h>
using namespace std;


int main(void) {
    int hash[26]={0};
    char a[100];
    cin>>a;
   
    for(int i=0;i<strlen(a);i++)
    {
        hash[a[i]-97]++;
    }
   
    for(int i=0;i<26;i++)
    {
        if(hash[i]>=1)
        {
            char x=i+97;
            cout<<x<<hash[i];
        }
      
        }
   
    return 0;
}

Convert resultset object to list of map

Convert the resultset object to list of map In some cases, while we doing API automation, we need to fetch the value from the DB and hav...