Moving Average from Data Stream
@hot13399 very nifty way to simulate a circular buffer through a bounded queue!
@liumingyu cool but your solution takes O(m) for next. You should achieve O(1) complexity.
@chanjjeaseo 700+ms It`s slow.But easy to understand.
It looks confusing when you initialize all the variables on a single line. Please consider breaking it up.
@publicstatic2 but we don't need to push from front or pop from the back in this problem. this is why queue is enough
No one has replied
Good usage on LINQ. I added my code if it's asking for optimization/LINQ is not allowed to use.
From 400ish ms to 200ish ms
@palindrome018 said in Clear C++ Solution:
Need a Q.push(val); before the m_sum += val;
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.