#include <vector> #include <string> #include <queue> #include <algorithm> #include <sstream> using namespace std; struct Event { int timestamp; int userId; }; struct CompareEvent { bool operator()(const Event& a, const Event& b) const { return a.timestamp > b.timestamp; } }; class Solution { public: vector<int> trackMentions(int totalUsers, vector<vector<string>>& eventLogs) { // Sort events based on timestamp sort(eventLogs.begin(), eventLogs.end(), [&](const vector<string>& a, const vector<string>& b) -> bool { return stoi(a[1]) < stoi(b[1]); }); // Initialize mentions and online status arrays vector<int> mention...
Comments
Post a Comment