All challenges

Algorithm challenge · DSA

Fibonacci Number

Difficulty

easy

Time

~10m

Format

Single

Grading

Auto-graded

#python#javascript#typescript#go#java#cpp#rust#dsa#recursion#math
Mission file // read carefullyeasy

Calculate the n-th Fibonacci number. Fib(0) = 0, Fib(1) = 1, Fib(n) = Fib(n-1) + Fib(n-2).

n = 4  =>  3

Build with

fib(n: int) → int
PythonJavaScriptTypeScriptGoJavaC++Rust
4 tests · 1 hidden
Auto-graded on submit
Start challenge

Sign in to save your progress.