Available question text
Implement a factory function createCounter(init) that captures an initial integer and returns three methods—increment, decrement, and reset—that update and return the internal counter value (increment adds 1, decrement subtracts 1, reset restores init).
Related questions
Continue with questions that share topics or the same question type.
- Counter
Coding
- Design Hit Counter
Coding · Array · Binary Search · Data Stream
- Implement Chat Event Counter
Coding
- 0/1 Knapsack Problem with Time Complexity Optimization
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2665. Counter II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source