i am not able to think about any approach other than :-
I make a comparator for first digit ,if they are equal then the next .
But how to design such comparator function.
Form biggest number
hey @Gautampriyadarshi comparator of this is really simple, given two string a and b you need to sort in such fashion that if a+b>b+a then a comes before b. Since we already have the required expression a+b>b+a, we’ll use it to construct comparator.
Compartor would accept 2 strings a and b and simply return a+b > b+a.
Code:
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.