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?
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?
Count posts per author, then run a greedy that places from whichever author has the most remaining, holding the author you just placed out for one turn before it goes back in. O(n log k), where k is the number of authors.
CS fundamentals and algorithmsShort answerAdvanced
You have tens of thousands of places with an id and coordinates (latitude, longitude)…
#heap
ArchitectureShort answerAdvanced
You want to change the feed screen's section makeup, order, and card types without…
#feed
Memory and ARCMultiple choiceIntro
Which statement about the stack and the heap is correct?
#heap
Memory and ARCShort answerAdvanced
What actually happens in memory when a closure captures an outside variable? Using the…
#heap