Design a simplified Twitter where users can post tweets, follow / unfollow other users, and read the 10 most recent tweets in their news feed.
Operations:
postTweet(userId, tweetId): composes a new tweet with idtweetIdby useruserId. Each call uses a uniquetweetId.getNewsFeed(userId): retrieve the 10 most recent tweet ids in the user's news feed. Each item must be posted by users the user follows or by the user themself. Tweets must be ordered from most recent to least recent.follow(followerId, followeeId):followerIdfollowsfolloweeId.unfollow(followerId, followeeId):followerIdunfollowsfolloweeId. (No-op if not currently following or if unfollowing self.)
For the auto-grader: implement twitterOps(operations). Each op is:
["postTweet", userId, tweetId]→null["getNewsFeed", userId]→ number[] (ids, most recent first, up to 10)["follow", followerId, followeeId]→null["unfollow", followerId, followeeId]→null