Medium20 min

Fibonacci Number

Return the nth Fibonacci number, where F(0) = 0 and F(1) = 1.

Your function

Implement solve(value, extra) in JavaScript. Return the answer; printing alone does not count as a result.

Examples

Input: [0]
Output: 0
Input: [1]
Output: 1

Constraints

0 ≤ value ≤ 30

13px
main.jsYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-84 lines

Test freely without an account. Signed-in submissions are checked independently by the isolated execution service before progress is awarded.