1352. Product of the Last K Numbers ¶
- Time:
- Constructor: $O(1)$
add(num: int)
: $O(1)$getProduct(k: int)
: $O(1)$
- Space: $O(|\texttt{add()}|)$
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
|