Whilst i am getting the correct answer but i am not sure why i am not passing the tests. :nction stairmaster(n) {
const arr = ;
const base = [1,2,3];
function generatePermutations(n, current) {
if (n === 0) {
arr.push(current);
return;
}
base.forEach(el => {
if (el <= n) {
generatePermutations(n - el, […current, el]);
}
});
}
generatePermutations(n, );
return arr;
}
console.log(stairmaster(5));
// Leave this so we can test your code:
module.exports = stairmaster;
Thanks!
Please check this out and format your post:
Thanks Lisa. I will delete this post and repost my question