Problem 2665 · Easy

Counter II

A closure keeps a private count and exposes increment, decrement and reset that all share the same state.

Open the interactive visualisation