Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 370 Bytes

Question_2629.md

File metadata and controls

18 lines (15 loc) · 370 Bytes

LeetCode Records - Question 2629 Function Composition

Attempt 1:

var compose = function(functions) {
    
    return function(x) {
        for (let i = functions.length - 1; i >= 0; i--) {
            x = functions[i](x);
        }
        return x;
    }
};
  • Runtime: 52 ms (Beats: 96.98%)
  • Memory: 50.21 MB (Beats: 28.76%)