leetcode

362. Design Hit Counter

Solution description

Solution code

window = 5 min = 300 sec

constructor

Time complexity: O(1)

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

hit

Time complexity: O(1)

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

getHits

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

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