Ezvor

2632. Curry

Medium Preparing judge… LeetCode

Hints

Hint 1
You can access the count of parameters expected to passed into a function with "fn.length".
Hint 2
You can use recursion. If the length of params passed is equal to fn.length, you are done. Just pass those params to fn. Otherwise return a function that is includes the previous passed params plus the new params. The new function should contain a recursive call to curry().