Question: I want cpp code Suppose you are responsible for building a log server that will receive a large number of logs . Each log will

I want cpp code
Suppose you are responsible for building a log server that will receive a large number of logs.Each log will have a log ID and timestamp. We want to keep track of these logs,but due to storage limitations,we can only return up to m logs from the last hour when requested.
Problem Statement
Complete the following functions
*recordLog(logld,timestamp): Records a new log entry.
*Each log is represented as an object with a logld and timestalap. The logld is an identifier for each log and the timestamp is an integer in seconds representing when the log was sent.
*Logs may be received out of order
*The log ID is not guaranteed to be unique -the same log ID can be used for different logs.
*getLogs).Returns a comma separated string of the latest m loglds from the last hour ascending by timestamp. In the event of a timestamp tie order from earliest received to latest.
*Return a string of the form
"logld1,logld2,logid3,logld4"where logld4is
the latest timestamp log and logld1is the earliest timestamp log received <1hour before logld4's timestamp
-getLogCount): Returns the total number of logs received <1hour from the most recently stored log timestamp. In the event more than m logs have been received still return the full count of logs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!