Design Twitter
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and see the 10 most recent tweets in their news feed. Implement the Twitter class with postTweet, getNewsFeed, follow, and unfollow methods.
Design Twitter

Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and see the 10 most recent tweets in their news feed. Implement the Twitter class with postTweet, getNewsFeed, follow, and unfollow methods.

Example 1:
Input: {"commands":["Twitter","postTweet","getNewsFeed","follow","postTweet","getNewsFeed","unfollow","getNewsFeed"],"values":[[],[1,5],[1],[1,2],[2,6],[1],[1,2],[1]]}
Output: [null,null,[5],null,null,[6,5],null,[5]]
Input
arr ={"commands":["Twitter","postTweet","getNewsFeed","follow","postTweet","getNewsFeed","unfollow","getNewsFeed"],"values":[[],[1,5],[1],[1,2],[2,6],[1],[1,2],[1]]}

Initialize Twitter

Operations

User Tweets

No tweets yet

Follows

No follows

News Feed (Top 10)

Empty feed

Current Op

Completed

Variables
No variables to display
DepthFunction Call
Stack empty
0/8