Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your function will return 2 for index = 4, whereas it's expecting 3.


Then are the instructions not clear enough, or am I just missing something....

From the website: "For example, the sequence [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] forms the first ten entries of the Fibonacci sequence." Entering 4 should return 2 in this case, which is correct? I don't get it.


Index 4 is the fifth element, 3. Index 0 is the first element (a zero).

Reread the examples.


Hmm...I see. Thank you for the help!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: