Question : LINK

Approach -

1 ) when will be answer No ?

case1 : If there is some value which occur greater than 2 times then answer is no

ex : 1 2 2 2 3 , No possible way to arrange right ?

case 2 : If the max value from array present twice , then answer is NO

ex : 1 1 2 2 3 we can rearrange as 1 2 3 2 1 , , but but let arr = 1 1 2 2 3 3 then how can we rearrange ? 1 2 3 3 2 1 As we clearly see two 3 occurs which violates the condition

Else there is always answer so how can we find , so simple ,do yourself

If any doubt please ask