How should i approach this question?

I am not getting ideas on approaching this question ? How should approach this ?

hi this is a question of string sorting using custome sort function

so our objective is to create the largest number
for a string to be largest we compare return the lexographically largest combination

check a+b > b+a
where a & b are string

Attaching the code for the same:
in case of doubts feel free to ask

Thanks i was able to solve it. Moreover i solved it without taking string too.

great!.
keep coding and good luck