Form biggest number bug

the output is comin out to be fine with this code yet not able to submit the code. Also why can’t i use ‘stoi’ or ;‘atoi’ forn converting a constant character string to int??

#include
#include
#include
#include
#include<bits/stdc++.h>
using namespace std;

int myCompare(string X, string Y)
{
string XY = X.append(Y);
string YX = Y.append(X);

return XY.compare(YX)>0?1:0;
}

string rearrange(vectorv)
{
string s = “”;
sort(v.begin(),v.end(),myCompare);
int m = v.size();
for(int i=0 ;i<m; i++)
s=s.append(v[i]);

return s;

}
int main() {
vectorv;
int arr[100];
int t;
cin>>t;
int n;
while(t–)
{
cin>>n;
for(int i=0; i<n; i++)
{
cin>>arr[i];
v.push_back(to_string(arr[i]));
}
string s = (rearrange(v));
for(int i=0;s[i];i++)
cout<<s[i]-‘0’;

}
return 0;
}

Hey Anudeep, can you copy your whole code on ide, save it and share that link, as the code you have copied here showing many compilation errors.

Hey Anudeep, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “Ask Doubt” section, when your doubt is resolved.