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.
Why will not greedy work here?
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