Skip to content

002/fibonacci.js #4

@eliane-meltzer

Description

@eliane-meltzer

Shouldn't line 4 should read while(f[0] <= 4e6) ?

Your code yields the right answer for an input of 4 million, but consider the fibonacci numbers not exceeding 8.

Even fibonaccis would be 2 and 8, resulting in a sum of 10. Your code would log 2 as the answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions