For this Question: We are given a string. Your task is to compress the consecutive letters of the string 

For example, given string is "AAACCCBBD", thus here
A's occurrence 3 times
C's occurrence 3 times
B's occurrence 2 times
D's occurrence 1 time
So after compressing string becomes "A3C3B2D1".The first line of input contains an integer T denoting the number of test cases. Each test case will have a string provided in the new line.

Constraints: 
1 <= T <= 10
1 <= sizeof(String) <= 10^6
All characters of String are upper case letters. (A-Z)

Sum of size of Strings over all testcases is <= 10^6For each testcase, in a new line, print the compressed string for each test case in a new line. Input:
2
AAACCCBBD
ABCD 

Output:
A3C3B2D1
A1B1C1D1, I have written this Solution Code: #include "bits/stdc++.h"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

void solve(){
	string s;	cin >> s;
	int c = 1;
	char p = 0;
	int n = s.length();
	for(int i = 1; i < n; i++){
		if(s[i] != s[i-1]){
			cout << s[i-1] << c;
			c = 1;
		}
		else
			c++;
	}
	cout << s[n-1] << c << endl;
}

void testcases(){
	int tt = 1; 
	cin >> tt;
	while(tt--){
		solve();
	}
}

signed main() {
	IOS;
		clock_t start = clock();

	testcases();

	cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms" << endl;
	return 0;
}	, In this Programming Language: C++, Now tell me if this Code is compilable or not?