Log Buffer Analyzer
You are given a logging system with a circular buffer that can hold up to n logs. Each log has a unique timestamp logTimestamp[i] (in milliseconds) and a tag logTag[i]. When a new log arrives, the system:
transmissionWindow).Implement a function that finds the total number of logs transmitted throughout the process as logs arrive, considering the circular buffer's capacity and the time window for transmission.
Complete the function getNumberTransmittedLogs in the editor 👉 👉 👉 🐣
getNumberTransmittedLogs takes the following parameters:
int logTimestamp[]: the recording times of logs in millisecondsstring logTag[]: the tags of logsint bufferCapacity: the capacity of the circular bufferint transmissionWindow: the time range (in milliseconds) within which logs sharing the same tag as the arriving log are transmitted
Returns
int: the number of logs transmitted during the process
A SUPER huge 🤟thank you🤟 to our incredible friend for everything they've contributed!
1Example 1

The logs received are as follows:
- Log 1: Timestamp = 1000 ms, Tag = "error"
- Log 2: Timestamp = 2000 ms, Tag = "warning"
- Log 3: Timestamp = 3000 ms, Tag = "error"
- Log 4: Timestamp = 4001 ms, Tag = "warning"
Condition of Buffer and logs transmitted during the process:
The total number of logs transmitted during the process is 5, thus, the function should return 5.