Implement a Counter class that tracks an integer count.
The Counter class should support the following operations:
Counter() — Initialize the counter with a count of 0.increment() — Increase the count by 1.decrement() — Decrease the count by 1.getCount() — Return the current count.reset() — Reset the count to 0.["Counter","increment","increment","increment","getCount","decrement","getCount","reset","getCount"]
[[],[],[],[],[],[],[],[],[]][null,null,null,null,3,null,2,null,0]At most 1000 calls will be made to increment, decrement, getCount, and resetThe count can be negative (decrementing below 0 is allowed)Run your code to see results
Use Cmd+Enter to run