fix(curriculum): clarify Fibonacci user story to use 0-indexed sequence (#67195)

Co-authored-by: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com>
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Brian Tripp
2026-05-04 02:46:33 -05:00
committed by GitHub
parent ccc32e1f59
commit 0e2af859d0
2 changed files with 4 additions and 4 deletions
@@ -13,9 +13,9 @@ dashedName: build-an-nth-fibonacci-number-calculator
1. You should create a function named `fibonacci`.
2. You should define an array named `sequence` within the `fibonacci` function, and it should be initialized with the values `[0, 1]`.
3. The `fibonacci` function should accept one parameter, a positive integer `n`.
3. The `fibonacci` function should accept one parameter, a non-negative integer `n`.
4. Calling `fibonacci(n)` should use a dynamic programming approach to compute and return the `n`-th number from the Fibonacci sequence, where each number is the sum of the two preceding numbers.
5. Each computed number at the position `n` in the Fibonacci sequence should be stored in the `sequence` array at index `n - 1`.
5. Each computed Fibonacci number should be appended to the `sequence` array.
# --hints--
@@ -13,9 +13,9 @@ dashedName: build-an-nth-fibonacci-number-calculator
1. You should create a function named `fibonacci`.
2. You should define a list named `sequence` within the `fibonacci` function, and it should be initialized with the values `[0, 1]`.
3. The `fibonacci` function should accept one parameter, a positive integer `n`.
3. The `fibonacci` function should accept one parameter, a non-negative integer `n`.
4. Calling `fibonacci(n)` should use a dynamic programming approach to compute and return the `n`-th number from the Fibonacci sequence, where each number is the sum of the two preceding numbers.
5. Each computed number at the position `n` in the Fibonacci sequence should be stored in the `sequence` list at index `n - 1`.
5. Each computed Fibonacci number should be appended to the `sequence` list.
# --hints--