freeCodeCamp / CurriculumExpansion

Creative Commons Attribution Share Alike 4.0 International
313 stars 105 forks source link

chore: add n-th Fibonacci number lab #490

Closed Dario-DC closed 1 month ago

Dario-DC commented 2 months ago

Checklist:

Closes #474

zairahira commented 2 months ago

It seems like the code is following a recursive approach rather than a dynamic approach. The goal of this lab isn't recursion according to the issue description.

Dario-DC commented 2 months ago

I refactored the code to use a bottom-up approach. This should count as dynamic @zairahira

I'm asking to create an array in the global scope to store the computed sequence numbers because I thought it would be easier to test. I'm not sure, though.

zairahira commented 2 months ago

This version implements the dynamic approach and it's looking good 🎉

Dario-DC commented 1 month ago

Good catch, I didn't realized it @moT01

moT01 commented 1 month ago

The prototype doesn't fulfill the user stories anymore. "You should define an empty array named sequence in the global scope." We should either adjust the user story, or write a different solution that starts with an empty array.

Dario-DC commented 1 month ago

The prototype doesn't fulfill the user stories anymore. "You should define an empty array named sequence in the global scope." We should either adjust the user story, or write a different solution that starts with an empty array.

My bad, I updated the name and forgot to fix the rest accordingly.