2620. Counter
https://leetcode.com/problems/counter
Javascript
var createCounter = function(n) {
let count = n
return function() {
return n++
};
}
Typescript
function createCounter(n: number): () => number {
let count = n
return function() {
return n++
}
}