We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81e55b4 commit 048e7faCopy full SHA for 048e7fa
lesson_07/conditionals/src/lesson7.ts
@@ -152,13 +152,13 @@ export function addNumbers(values: number[]): number {
152
export function getFirstNFibonacciNumbers(n: number): number[] {
153
const list: number[] = [];
154
const indices = Array.from({ length: n - 1 }, (_, index) => index + 2);
155
- if (n>=0){
156
- list.push(0);
157
- }
158
if (n>=1){
159
list.push(1);
160
}
161
if (n>=2){
+ list.push(1);
+ }
+ if (n>=3){
162
for (const i of indices) {
163
list[i] = list[i - 1] + list[i - 2];
164
0 commit comments