CS fundamentals and algorithmsAudible
Rearranging without adjacent duplicates
You have a list of posts for a feed and need to reorder them so that no two posts by the same author appear back to back. What algorithm do you use, and what's the time complexity?