I have solved this but it is fail. I cant understand why and also my code is run on gfg platform for the same question.
https://practice.geeksforgeeks.org/problems/largest-number-formed-from-an-array/0---it is the question. What is the problem?
Form Biggest Number problem
@Arnabiswas
problem can be in test cases.
for xample

here if a=100000 b=100000 then clearly ab or ba will not be in range of int therefore ur code is working for small test cases but fails for big numbers .
to rectify it;
dont convert to int just compare the a+b and b+a string directly i.e
return a+b > b+a
ok sir. Thank you. But sir,if I use long long int ab and long long int ba, then why error is occurred?