FIND Biggest Number

I have solved this question, and getting the correct answer for almost all the test cases what u could think of. But still the code is not being accepted and shows wrong answer. Can anyone look int the code and tell me where have i committed the mistake.
Link: https://ide.codingblocks.com/s/86566

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

int comp(int a,int b)
{
string ac = to_string(a);
//cout<<ac;
string bc = to_string(b);
//cout<<bc;
int i =0,digit1,digit2;
while(ac[i]!=NULL || bc[i]!=NULL)
{
digit1 = ac[i] - ‘0’;
digit2 = bc[i] - ‘0’;
if(digit1 == digit2)
i++;
else
break;
}
if(digit1>digit2)
return 1;
else
return 0;
}

void sort_arr(vector arr,int s)
{
int t;
for(int i=0;i<s;i++)
{
for(int j = i+1;j<s;j++)
{
if(!comp(arr[i],arr[j]))
{
t = arr[i];
arr[i]=arr[j];
arr[j] = t;
}
}
}

for(int i=0;i<s;i++)
{
    cout<<arr[i];
}

}

int main() {
int m,temp;
cin>>m;
while(m)
{
int s,t;
cin>>s;
vector arr;
for(int i=0;i<s;i++)
{
cin>>t;
arr.push_back(t);
}
sort_arr(arr,s);
cout<<endl;
arr.clear();
m–;
}

return 0;

}

@vidyajaykushwaha hey ajay consider this case
1
8
1 34 3 98 9 76 45 4
your output is
989764543431
but expected output is
998764543431

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.