i am trying to take the input in string array
and then sorting them in lexicographic order
Biggest number problem
Hey @bhattanurag426
Mentioned the changes in comments
Say we have 653 and 65361
Now we will place 653 first and 65361 later
why because 65361653<65365361
but ur code is doing otherwise
You have to make custom compare function
and compare if a+b>b+a and return accordingly
sir, but i am unable to understand why the output is same string as input
Actuall \n is considered as 1 string
Try taking 3 strings then ur output will contain 2 strings
To ignore \n cin.ignore() is used
i have referred your code still same output
Oh okay so i checked the input format there and all the strings are in same line
so u cant use getline() because it will take all strings as one
so use cin>>a[i] instead of that
thank you sir i got it now
1 Like
