Why is this code not working for this Question?

Why is this code not working for this Question?


hello @cbcao263

this is same question as form biggest number in cb module.

a) after sorting iterate from 0 to n-1 (because after sorting number will be in required order only)
b) u cannot append number to string , so first convert number to string and then append.
c) to use custom comparator inside class make ur comparator as static

check ur updated code->

Thanks Sir
2 Doubts of mine: -

  1. Will not it convert the number to decreasing order as being explained by Kartik Sir in FAANG Course.
  2. Why to declare static?

u need to form largest na …so obviously order of number should be decreasing from left to right.

answer

Oh Sorry for that increasing.
As Sir told 2 methods one is bubble sort and other is using com function
So In the case of 3,30,9 it will be like 30,3,9 in Bubble Sort as logic explained
But I thought it will be same here too.

which video u r refering?
pls share the link with me

https://online.codingblocks.com/app/player/123939/content/132436/8767/lecture

It’s in FAANG Course.

This is the pic
Here sir explained by bubble sort and told like 3,30 so first number will be 330 and second will be 303, If they are greater swap

Sorry, SS isn’t working here :frowning:

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.