Biggest number problem

for problem form biggest number i am getting correct answer in my ide but could nit pass a sinlgle test cases

@chiragbaid7
hello chirag,
pls share ur code

#include<bits/stdc++.h> #include using namespace std; int main() { int testcase;cin>>testcase; while(testcase) { int size;cin>>size; int array[size]; string stringarray[size]; for(int i=0;i<size;i++) { cin>>array[i]; stringarray[i]=to_string(array[i]); } sort(stringarray,stringarray+size,greater()); for(int i=0;i<size;i++) { cout<<stringarray[i]; } testcase–; } }

@chiragbaid7
hello chirag,
inbuilt greater comparator will not work here.
u need to define ur own comparator and pass in sort function

ur comparator should be like
bool cmp( string a ,string b){
return a+b > b+a;
}

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.