Form Biggest Number

Question:
https://online.codingblocks.com/app/player/67747/content/107303/5316/code-challenge

Answer:

I tried with many custom test cases and this code always gave the correct answer
but when i submit it fails all the test cases except the 1st one.

@Abhishek.1514 you can use a simple sort function also.
I’ll tell you what the comparison function for a simple sort function on a vector of strings should look like, you can modify it accordingly to fit your logic of using a priority queue.

bool compare(string a, string b) {
    return a+b > b+a;
}

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.