Download Number of Recent Calls.py
class RecentCounter(object): def __init__(self): self.queue =  def ping(self, t): """ :type t: int :rtype: int """ self.queue.append(t) while self.queue and self.queue < t - 3000: self.queue.pop(0) return len(self.queue) # Your RecentCounter object will be instantiated and called as such: # obj = RecentCounter() # param_1 = obj.ping(t)
Leetcode 933 Number of Recent Calls problem solution in python3 with explanation. This is the best place to expand your knowledge and get prepared for your next interview.
Feedback is the most important part of any website.
If you have any query, suggestion or feedback, Please feel free to contact us.