How can I reorder the array in C to achieve a long-tail word?