Search
⌘K

Leetcode 2620. Counter

Return a function (closure) that captures an initial integer n and, on each invocation, returns n for the first call and increments by 1 on every subsequent call, producing the sequence n, n+1, n+2, ... .


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.