Back to problems

Frontend Curry: addTwoNumbers → addThreeNumbers(a)(b)(c)

Algorithm · Salesforce · Medium

Requirements Write addThreeNumbers so that addThreeNumbers(1)(2)(3) === 6. Preserve the three-stage invocation pattern: every invocation must yield either the next function in the chain or the completed numeric result. Use JavaScript or TypeScript only; React is not permitted in CoderPad. The judged entry point is: Typical extensions raised during this interview include: Expand the idea into addN(a)(b)(c)..., with no fixed number of inputs. The curried sequence ends when it…

Checking your access…