Back to problems

Snapshot Social Graph

Object-Oriented Programming · OpenAI · Medium

Implement a social network that records follow relationships between users while preserving the history of changes through snapshots. Users can follow and unfollow each other as time progresses, and you must be able to query whether a specific follow relationship was active at any past snapshot. Implement the SocialNetwork class: SocialNetwork() Initializes an empty network. void follow(int followerId, int followeeId) Registers that followerId starts following followeeId in…

Checking your access…