> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0355_design_twitter/slt.md).

# 思路1 记录每个tweid的时间。get的时候按时间归并

struct Node { unordered\_set followee; list tweet; }; int recent\_max, time; unordered\_map tweet\_time; unordered\_map user;

关键是设计好数据结构。最后在getNewsFeed时，根据tweet\_time找到时间进行线性归并

userId -> Node { followee set tweet list }
