Company: Meesho_29june
Difficulty: medium
StackOverFlow System Problem Description You are building the question board of a small StackOverFlow-like site. Users post questions. Every question is stored with the text of the question (its content ), the name of the user who posted it (its author ), and a vote count that starts at 0 . Other users can upvote or downvote a question, an author can delete a question, and anyone can look a question up or ask for an author's most popular questions. The board also forgets. A question that nobody interacts with slowly loses votes: this is the decay rule described below. The board processes Q queries, one per line. The queries are numbered 1, 2, 3, ... , Q and the number of a query is also called its time . The first query happens at time 1 , the second at time 2 , and so on. Questions and ids The first question posted gets id 0 , the second gets id 1 , and so on. Ids are never reused, not even after a delete. Every question keeps a last-activity time , which is set to the time of the que