Showing incorrect

my code is giving as wrong ans in inbuilt compiler but when i tested with all the given test case of editor it is showing same output as written in solution. still my code is getting rejected

#include
#include
#include
#include
#include
using namespace std;
int opp1(string a){
int l = a.length();
string num ="";
for (int i =0; i<l;i++){
if (‘0’<= a[i] && a[i]<=‘9’){
num+=a[i];
//l–;

}
}
stringstream s (num);
int k =0;
s >> k;
return k;

}
bool comp (string a,string b){
//string num = opp1(a);
//string num2=opp1(b);
int numi = opp1(a);//0;//stoi(num);
int numi2= opp1(b);//0;//stoi(num2);

//stringstream geek(num);
//geek >> numi;

//stringstream geek2(num2);
//geek2 >> numi2;

if (numi==numi2){
return a>b;
}
else {
return numi<numi2;
}

}
void sortfunc(string arr[], int n) {

    for (int i = 0; i < n; i++) {

        for (int j = 0; j < n - i - 1; j++) {

            if (comp(arr[j], arr[j + 1])) {

                string temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }

        }
    }

}

int main() {
int n;
cin>>n;
int t;
// cin.get();
cin>>t;
string arr[t]={};
int j =0;
cin.get();
for (int i =0;i<t;i++){
string a1="";
// cin.get();
getline(cin,a1);
//cin>>a1;
//arr[i]=a1;
int nu = opp1(a1);
if(nu>=n){
arr[j]=a1;
j++;
}

}

// string sarr[1000];

// sort(arr,arr+t,comp);
sortfunc(arr,j+1);

//cout<<endl;

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


return 0;

}

Hey @pratik.win
Share your code in Coding blocks ide :slight_smile:

codingblock ide isnt working properly. plz look in this https://onlinegdb.com/ByGi1BsKv

Hey @pratik.win
Yes its working correctly on given testcases
Maybe background test cases are different
So let me point out some mistakes
Stringname can also contain nos
So ur no extraction wont work like that
Try using array/vector of pairs

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.