Leetcode 969 Solution
This article provides solution to leetcode question 969 (number-of-recent-calls)
Access this page by simply typing in "lcs 969" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
class RecentCounter: def __init__(self): self.pings = collections.deque() def ping(self, t: int) -> int: while self.pings and self.pings < t - 3000: self.pings.popleft() self.pings.append(t) return len(self.pings) # Your RecentCounter object will be instantiated and called as such: # obj = RecentCounter() # param_1 = obj.pings(t)