can you tell what is wrong with this code?
#include
bool compare(int a, int b)
{int i=0;
string q=to_string(a);
string w=to_string(b);
while(q[i]!=NULL && w[i]!=NULL)
{int e=stoi(&q[i]);
int r=stoi(&w[i]);
if(e>r)
{return true;}
i++;
}
return false;
}
string Solution::largestNumber(const vector &A) {
int n=A.size();
sort(A.begin(), A.end(), compare);
string s;
int i;
for(i=0;i<n;i++)
{
s=s+to_string(A[i]);
}
return s;
}
it is the part of a question.