목록알고리즘/과제 (27)
게으른개발너D
https://leetcode.com/problems/allow-one-function-call/description/ Allow One Function Call - LeetCode Can you solve this real interview question? Allow One Function Call - Given a function fn, return a new function that is identical to the original function except that it ensures fn is called at most once. * The first time the returned function is calle leetcode.com Given a function fn, return a..
https://leetcode.com/problems/counter-ii/description/ Counter II - LeetCode Can you solve this real interview question? Counter II - Write a function createCounter. It should accept an initial integer init. It should return an object with three functions. The three functions are: * increment() increases the current value by 1 leetcode.com Write a function createCounter. It should accept an initi..
https://leetcode.com/problems/generate-fibonacci-sequence/ Generate Fibonacci Sequence - LeetCode Can you solve this real interview question? Generate Fibonacci Sequence - Write a generator function that returns a generator object which yields the fibonacci sequence. The fibonacci sequence is defined by the relation Xn = Xn-1 + Xn-2. The first few leetcode.com Write a generator function that ret..
https://leetcode.com/problems/promise-time-limit/ Promise Time Limit - LeetCode Can you solve this real interview question? Promise Time Limit - Given an asynchronous function fn and a time t in milliseconds, return a new time limited version of the input function. fn takes arguments provided to the time limited function. The leetcode.com Given an asynchronous function fn and a time t in millise..
https://leetcode.com/problems/apply-transform-over-each-element-in-array/ Apply Transform Over Each Element in Array - LeetCode Can you solve this real interview question? Apply Transform Over Each Element in Array - Given an integer array arr and a mapping function fn, return a new array with a transformation applied to each element. The returned array should be created such t leetcode.com Give..
https://leetcode.com/problems/filter-elements-from-array/ Filter Elements from Array - LeetCode Can you solve this real interview question? Filter Elements from Array - Given an integer array arr and a filtering function fn, return a filtered array filteredArr. The fn function takes one or two arguments: * arr[i] - number from the arr * i - index leetcode.com Given an integer array arr and a fil..
https://leetcode.com/problems/function-composition/ Function Composition - LeetCode Can you solve this real interview question? Function Composition - Given an array of functions [f1, f2, f3, ..., fn], return a new function fn that is the function composition of the array of functions. The function composition of [f(x), g(x), h( leetcode.com Given an array of functions [f1, f2, f3, ..., fn], ret..
https://leetcode.com/problems/array-reduce-transformation/ Array Reduce Transformation - LeetCode Can you solve this real interview question? Array Reduce Transformation - Given an integer array nums, a reducer function fn, and an initial value init, return a reduced array. A reduced array is created by applying the following operation: val = f leetcode.com Given an integer array nums, a reducer..