You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The task: here
The solution i am submitting works localy for me in VSC. I've tried to console.log, to see the input only, but still this error occurs:
Anyway the code for the solution is:
function lastKNumbersSequence(nTimes, kLastEl){
let result = [1];
for(let i = 1; i < nTimes; i++){
let startIndex = Math.max(0, i-kLastEl);
let curElement = result.slice(startIndex, startIndex + kLastEl).reduce((acc, el) => acc + el, 0);
result.push(curElement);
}
console.log(result);
}
The text was updated successfully, but these errors were encountered:
The task: here
The solution i am submitting works localy for me in VSC. I've tried to console.log, to see the input only, but still this error occurs:
Anyway the code for the solution is:
The text was updated successfully, but these errors were encountered: