why my code is not producing any output for the test cases?
Form Biggest No
hope this works β¦idk how to post codes hereβ¦
Hi @i_am_dekard_shaw,
Your code seems fine except the comparision function for sorting that you are using.
since greater() will compare the strings lexicographically, that might be wrong for many case.
Suppose you are comparing two strings βaβ and βbβ. your aim is to swap two strings if and only if value of a+b is greater than b+a (Note: β+β is concatenation of two strings)and here I am comparing these two strings of same length(=length(a)+length(b)).
Refer the code here: https://ide.codingblocks.com/s/169504
If you have any doubt, please do ask.
Thanks,
1 Like