Search
⌘K

Leetcode 2666. Allow One Function Call

Return a wrapper for a given function that calls the original at most once: it should invoke and return fn's result on the first call, then always return undefined on subsequent calls (use a closure to track call state).


Question Timeline

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

Comments

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