{"size": 364, "ext": "js", "max_stars_repo_path": "coding-challenges/climbstairs.js", "max_stars_repo_name": "nunulong/algorithms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "coding-challenges/climbstairs.js", "max_issues_repo_name": "nunulong/algorithms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "coding-challenges/climbstairs.js", "max_forks_repo_name": "nunulong/algorithms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.0, "max_line_length": 86, "alphanum_fraction": 0.4972527473}
const climbStairs = (n) => {
    const helper = (n, cache) => {
        if (n < 0) return 0;
        if (n === 0) return 1;
        if (cache[n] > 0) return cache[n];
        cache[n] = helper(n - 1, cache) + helper(n - 2, cache) + helper(n - 3, cache);
        return cache[n];
    }
    const arr = [];
    return helper(n, arr);
}

console.log(climbStairs(30));