leetcode

933. Number of Recent Calls

Solution code

constructor

Time complexity: O(1)

Space complexity: O(1)

ping

_n = calls = 3000_

Time complexity: O(n) = O(1)

Space complexity: O(n) = O(1)