Why will not greedy work here?

i mean if i sort them in ascending order then if i do multiplication with the ith element then will it not give me largest value.

Have you tried submitting this approach? I think it should work especially due to the smaller constraints

But , how constraints will affect this question !! Btw yes the test case passed but i want to know when will i get WA

constraints because, greedy will take atleast nlogn
I do not think it will give WA with greedy

Hello @aryan_007 you have raised the doubt again.
could you please tell me how can i help you?